mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
simplify the gzip optimization logic
fix https://github.com/chrislusf/seaweedfs/issues/436
This commit is contained in:
parent
9fa648e570
commit
4beaaa0650
|
@ -144,11 +144,13 @@ func ParseUpload(r *http.Request) (
|
|||
isGzipped = true
|
||||
}
|
||||
if ext == ".gz" {
|
||||
if strings.HasSuffix(fileName, ".css.gz") ||
|
||||
strings.HasSuffix(fileName, ".html.gz") ||
|
||||
strings.HasSuffix(fileName, ".txt.gz") ||
|
||||
strings.HasSuffix(fileName, ".js.gz") {
|
||||
fileName = fileName[:len(fileName)-3]
|
||||
isGzipped = true
|
||||
}
|
||||
if strings.HasSuffix(fileName, ".gz") &&
|
||||
!strings.HasSuffix(fileName, ".tar.gz") {
|
||||
fileName = fileName[:len(fileName)-3]
|
||||
}
|
||||
}
|
||||
modifiedTime, _ = strconv.ParseUint(r.FormValue("ts"), 10, 64)
|
||||
|
|
Loading…
Reference in a new issue