You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the call to w.Writer.Write in gzipResponseWriter.Write returns 0, ErrContentLength ("Conn.Write wrote more than the declared Content-Length"). I believe this is because ReverseProxy.ServeHTTP calls ResponseWriter.WriteHeader which stores the current (pre-gzip) Content-Length value in the response before it writes the body out.
I was able to fix this problem by adding this method to gzipResponseWriter:
The text was updated successfully, but these errors were encountered:
nwidger
changed the title
httpgzip.NewHandler breaks when used with httputil.NewSingleHostReverseProxy
httpgzip.NewHandler breaks when used with httputil.NewSingleHostReverseProxy
Dec 9, 2014
When
httputil.NewSingleHostReverseProxy
is wrapped withhttpgzip.NewHandler
, i.e.the call to
w.Writer.Write
ingzipResponseWriter.Write
returns0, ErrContentLength
("Conn.Write wrote more than the declared Content-Length"). I believe this is becauseReverseProxy.ServeHTTP
callsResponseWriter.WriteHeader
which stores the current (pre-gzip) Content-Length value in the response before it writes the body out.I was able to fix this problem by adding this method to
gzipResponseWriter
:The text was updated successfully, but these errors were encountered: