revert PR #1903 avoid http error: superfluous response.WriteHeader

This commit is contained in:
Chris Lu
2021-05-05 15:11:39 -07:00
parent 24efa31e49
commit ac71117ee6
11 changed files with 22 additions and 48 deletions

View File

@@ -326,11 +326,7 @@ func passThroughResponse(proxyResponse *http.Response, w http.ResponseWriter) {
for k, v := range proxyResponse.Header {
w.Header()[k] = v
}
if proxyResponse.Header.Get("Content-Range") != "" && proxyResponse.StatusCode == 200 {
w.WriteHeader(http.StatusPartialContent)
} else {
w.WriteHeader(proxyResponse.StatusCode)
}
w.WriteHeader(proxyResponse.StatusCode)
io.Copy(w, proxyResponse.Body)
}