We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e889a6 commit bbe0d88Copy full SHA for bbe0d88
main.go
@@ -162,12 +162,18 @@ func setContentType(r *http.Request, resp *http.Response) {
162
return
163
}
164
165
+ currentMime := resp.Header.Get("Content-Type")
166
fnameHeader := resp.Header.Get("ZIPSVR_FILENAME")
167
fname := strings.TrimSpace(r.URL.Path)
168
rext := strings.ToLower(filepath.Ext(fnameHeader))
169
ext := strings.ToLower(filepath.Ext(fname))
170
mime := ""
171
172
+ if (ext == ".php" || rext == ".php") && currentMime != "" {
173
+ // Keep content types set by php script if available
174
+ return
175
+ }
176
+
177
// If the request already has an extension, fetch the mime via extension
178
if ext != "" && len(ext) > 1 {
179
e := ext[1:]
0 commit comments