diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-16 10:44:45 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-16 10:44:45 -0700 |
commit | 9fe54e1c6025a45cdd531c093bb94d193a8b91a0 (patch) | |
tree | f626e93f4cba647db20fb04f3a6dfa5d5610a6d1 /modules/caddyhttp/fileserver/staticfiles.go | |
parent | b43e986a526c9de83c04c29bc530f1d711a40997 (diff) |
file_server: Use HTTPS port when a qualifying domain is specified
Also little comment cleanups
Diffstat (limited to 'modules/caddyhttp/fileserver/staticfiles.go')
-rw-r--r-- | modules/caddyhttp/fileserver/staticfiles.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go index d1791db..732894d 100644 --- a/modules/caddyhttp/fileserver/staticfiles.go +++ b/modules/caddyhttp/fileserver/staticfiles.go @@ -150,9 +150,6 @@ func (fsrv *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next c return fsrv.notFound(w, r, next) } - // TODO: maybe there should be a way to serve the next handler - // instead of returning 404 if a file is not found? - // TODO: content negotiation (brotli sidecar files, etc...) // one last check to ensure the file isn't hidden (we might @@ -193,7 +190,7 @@ func (fsrv *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next c if mtyp == "" { // do not allow Go to sniff the content-type; see // https://www.youtube.com/watch?v=8t8JYpt0egE - // TODO: Consider writing a default mime type of application/octet-stream - this is secure but violates spec + // TODO: If we want a Content-Type, consider writing a default of application/octet-stream - this is secure but violates spec w.Header()["Content-Type"] = nil } else { w.Header().Set("Content-Type", mtyp) |