Skip to content

Commit dae0f66

Browse files
committed
fix: Clear charset definition from responses from legacy servers
1 parent b3975b7 commit dae0f66

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ func setContentType(r *http.Request, resp *http.Response) {
169169
ext := strings.ToLower(filepath.Ext(fname))
170170
mime := ""
171171

172+
if currentMime == "text/html; charset=utf-8" {
173+
currentMime = "text/html"
174+
resp.Header.Set("Content-Type", currentMime)
175+
}
176+
172177
if (ext == ".php" || rext == ".php") && currentMime != "" {
173178
// Keep content types set by php script if available
174179
return

0 commit comments

Comments
 (0)