added Content-Length header for GET requests

This commit is contained in:
milarin 2022-12-19 13:20:07 +01:00
parent a4cb2922fa
commit 7e25c34766

View File

@ -69,6 +69,7 @@ func get(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Content-Type", getMimetype(path)) w.Header().Add("Content-Type", getMimetype(path))
w.Header().Add("File-Permissions", fi.Mode().Perm().String()) w.Header().Add("File-Permissions", fi.Mode().Perm().String())
w.Header().Add("Modified-Time", fi.ModTime().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)) username, groupname, err := getOwnerNames(getOwnerIDs(fi))
if err == nil { if err == nil {