• Matthew Holt's avatar
    Revert recent Content-Length-related changes and fix fastcgi return · 2a46f2a1
    Matthew Holt authored
    fastcgi's ServeHTTP method originally returned the correct value (0) in
    b51e8bc1. Later, I mistakenly suggested
    we change that to return the status code because I forgot that status
    codes aren't logged by the return value. So fastcgi broke due in
    3966936b due to my error.
    
    We later had to try to make up for this with ugly Content-Length checks
    like in c37ad7f6. Turns out that all we
    had to do was fix the returned status here back to 0. The proxy
    middleware behaves the same way, and returning 0 is correct. We should
    only return a status code if the response has not been written, but with
    upstream servers, we do write a response; they do not know about our
    error handler.
    
    Also clarifed this in the middleware.Handler documentation.
    2a46f2a1
fastcgi_test.go 3.75 KB