Compare commits
No commits in common. "a690b76c4256fdeae80ee229f1bf956b3d506a8d" and "1cd15d51e4a628c2f792e5df0c1c0e0ae75b4ab9" have entirely different histories.
a690b76c42
...
1cd15d51e4
2 changed files with 2 additions and 14 deletions
12
README.md
12
README.md
|
|
@ -16,17 +16,7 @@ indir [--host address] [--port port] [--root http_root] directory
|
||||||
--root http_root hosts on the specified subdirectory, i.e. `/files/`
|
--root http_root hosts on the specified subdirectory, i.e. `/files/`
|
||||||
```
|
```
|
||||||
|
|
||||||
## customization
|
|
||||||
|
|
||||||
### readme
|
|
||||||
drop a `README.md` into any directory and indir will render
|
|
||||||
it below the file listing with full markdown support!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## to-do:
|
## to-do:
|
||||||
- [x] use templates instead of hard-coded HTML (i was lazy)
|
- [x] use templates instead of hard-coded HTML (i was lazy)
|
||||||
- [x] directory header from readme file
|
- [ ] directory header from readme file
|
||||||
- [ ] directory stylesheet overrides
|
- [ ] directory stylesheet overrides
|
||||||
- [x] index.html serving support
|
|
||||||
- [x] fix mime-types for browser file view
|
|
||||||
4
main.go
4
main.go
|
|
@ -154,9 +154,7 @@ func main() {
|
||||||
mimeType := "application/octet-stream"
|
mimeType := "application/octet-stream"
|
||||||
extPos := strings.LastIndex(info.Name(), ".")
|
extPos := strings.LastIndex(info.Name(), ".")
|
||||||
if extPos != -1 {
|
if extPos != -1 {
|
||||||
if m := mime.TypeByExtension(info.Name()[extPos:]); m != "" {
|
mimeType = mime.TypeByExtension(info.Name()[:extPos])
|
||||||
mimeType = m
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", mimeType)
|
w.Header().Set("Content-Type", mimeType)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue