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) { ...@@ -287,7 +287,7 @@ func TestDeniedXSendfileDownload(t *testing.T) {
t.Fatalf(`X-Sendfile-Type want "X-Sendfile" got %q`, xSendfileType) t.Fatalf(`X-Sendfile-Type want "X-Sendfile" got %q`, xSendfileType)
} }
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, contentFilename)) w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, contentFilename))
w.WriteHeader(404) w.WriteHeader(200)
fmt.Fprint(w, "Denied") fmt.Fprint(w, "Denied")
})) }))
defer ts.Close() defer ts.Close()
......
...@@ -38,7 +38,7 @@ func xSendFile(u *upstream, w http.ResponseWriter, r *http.Request, _ func(http. ...@@ -38,7 +38,7 @@ func xSendFile(u *upstream, w http.ResponseWriter, r *http.Request, _ func(http.
} }
// Use accelerated file serving // Use accelerated file serving
if sendfile == "" && upResponse.StatusCode/100 != 2 { if sendfile == "" {
// Copy request body otherwise // Copy request body otherwise
w.WriteHeader(upResponse.StatusCode) 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