Reenable gzipping, pull in statigz fix, fix proxy prefix (#2039)

Co-authored-by: peolic <66393006+peolic@users.noreply.github.com>
This commit is contained in:
kermieisinthehouse
2021-11-18 18:30:21 -08:00
committed by GitHub
parent 9a76b4cf11
commit 74fcaa9a3f
12 changed files with 29 additions and 465 deletions

View File

@@ -216,6 +216,11 @@ func (s *Server) serve(rw http.ResponseWriter, req *http.Request, fn, suf, enc s
ctype = "application/octet-stream" // Prevent unreliable Content-Type detection on compressed data.
}
// This is used to enforce application/javascript MIME on Windows (https://github.com/golang/go/issues/32350)
if strings.HasSuffix(req.URL.Path, ".js") {
ctype = "application/javascript"
}
rw.Header().Set("Content-Type", ctype)
rw.Header().Set("Etag", info.hash)