From 7e25c347661e98f0f457b8fb75ef34241e90853f Mon Sep 17 00:00:00 2001 From: milarin Date: Mon, 19 Dec 2022 13:20:07 +0100 Subject: [PATCH] added Content-Length header for GET requests --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index 8e5ff4d..178dd5e 100644 --- a/main.go +++ b/main.go @@ -69,6 +69,7 @@ func get(w http.ResponseWriter, r *http.Request) { w.Header().Add("Content-Type", getMimetype(path)) w.Header().Add("File-Permissions", fi.Mode().Perm().String()) w.Header().Add("Modified-Time", fi.ModTime().String()) + w.Header().Add("Content-Length", strconv.FormatInt(fi.Size(), 10)) username, groupname, err := getOwnerNames(getOwnerIDs(fi)) if err == nil {