dont gzip a gzip and .js.gz has contenttype javascript

This commit is contained in:
bel
2023-05-07 19:34:42 -06:00
parent 5a2340cc1d
commit 2d1170f158
2 changed files with 6 additions and 0 deletions

View File

@@ -82,6 +82,9 @@ func SetContentTypeIfMedia(w http.ResponseWriter, r *http.Request) {
case ".gz":
w.Header().Set("Content-Encoding", "gzip")
v = "application/gzip"
if path.Ext(r.URL.Path) == ".js.gz" {
v = "application/javascript"
}
case ".gif":
v = "image/gif"
case ".htm,":