Commit b51e8bc1 authored by Matthew Holt's avatar Matthew Holt

fastcgi: Fix for handling errors that come from responder

parent 27722463
...@@ -111,12 +111,15 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) ...@@ -111,12 +111,15 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
w.WriteHeader(resp.StatusCode) w.WriteHeader(resp.StatusCode)
// Write the response body // Write the response body
// TODO: If this has an error, the response will already be
// partly written. We should copy out of resp.Body into a buffer
// first, then write it to the response...
_, err = io.Copy(w, resp.Body) _, err = io.Copy(w, resp.Body)
if err != nil { if err != nil {
return http.StatusBadGateway, err return http.StatusBadGateway, err
} }
return resp.StatusCode, nil return 0, nil
} }
} }
......
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