Commit 1632cfe6 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove 2xx check in xSendFile

parent 2dbb5485
......@@ -287,7 +287,7 @@ func TestDeniedXSendfileDownload(t *testing.T) {
t.Fatalf(`X-Sendfile-Type want "X-Sendfile" got %q`, xSendfileType)
}
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, contentFilename))
w.WriteHeader(404)
w.WriteHeader(200)
fmt.Fprint(w, "Denied")
}))
defer ts.Close()
......
......@@ -38,7 +38,7 @@ func xSendFile(u *upstream, w http.ResponseWriter, r *http.Request, _ func(http.
}
// Use accelerated file serving
if sendfile == "" && upResponse.StatusCode/100 != 2 {
if sendfile == "" {
// Copy request body otherwise
w.WriteHeader(upResponse.StatusCode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment