Skip to content

Commit

Permalink
fix(gateway): ensure directory listings have Content-Type text/html
Browse files Browse the repository at this point in the history
Files already have an explicit Content-Type set. Be sure to do this for
directory listings as well to avoid a fallback to autodetection in
net/http. That fallback fails when a ResponseWriter is installed that
performs compression.
  • Loading branch information
Lekensteyn committed May 18, 2020
1 parent 043acbd commit 4885c94
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
return
}

w.Header().Set("Content-Type", "text/html")
if r.Method == http.MethodHead {
return
}
Expand Down

0 comments on commit 4885c94

Please sign in to comment.