From 4ee46d8f5246e6449579f18499eb348ecf28cf9b Mon Sep 17 00:00:00 2001 From: supitszaire Date: Tue, 17 Mar 2026 00:57:20 +0100 Subject: [PATCH 1/3] updated readme to reflect additions added section: customization>readme added TODO & checked off things that are done --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f25adc..0f6d330 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,17 @@ indir [--host address] [--port port] [--root http_root] directory --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: - [x] use templates instead of hard-coded HTML (i was lazy) -- [ ] directory header from readme file +- [x] directory header from readme file - [ ] directory stylesheet overrides +- [x] index.html serving support +- [ ] fix mime-types for browser file view \ No newline at end of file From fccba73bacfdc08e9ac1b806974c7abcc684e140 Mon Sep 17 00:00:00 2001 From: zaire Date: Tue, 17 Mar 2026 10:49:09 +0100 Subject: [PATCH 2/3] FIX: mime-type returning only octet-stream --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 78c8271..a7a0b01 100755 --- a/main.go +++ b/main.go @@ -154,7 +154,9 @@ func main() { mimeType := "application/octet-stream" extPos := strings.LastIndex(info.Name(), ".") if extPos != -1 { - mimeType = mime.TypeByExtension(info.Name()[:extPos]) + if m := mime.TypeByExtension(info.Name()[extPos:]); m != "" { + mimeType = m + } } w.Header().Set("Content-Type", mimeType) From 523aa894d0cb8ebc0269c94a7cb50bdaba07cc2c Mon Sep 17 00:00:00 2001 From: supitszaire Date: Tue, 17 Mar 2026 10:52:04 +0100 Subject: [PATCH 3/3] update: reflect MIME-TYPE fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f6d330..f6825ec 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ it below the file listing with full markdown support! - [x] directory header from readme file - [ ] directory stylesheet overrides - [x] index.html serving support -- [ ] fix mime-types for browser file view \ No newline at end of file +- [x] fix mime-types for browser file view \ No newline at end of file