mirror of
https://github.com/containous/traefik.git
synced 2025-03-19 18:50:12 +03:00
Fix content-length header assertion
Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
4fd6b10b7d
commit
cdd24e91b4
@ -179,7 +179,6 @@ func (c *conn) handleResponse(r rwWithUpgrade) error {
|
||||
}
|
||||
|
||||
res.Reset()
|
||||
res.Header.Reset()
|
||||
res.Header.SetNoDefaultContentType(true)
|
||||
|
||||
continue
|
||||
@ -216,7 +215,7 @@ func (c *conn) handleResponse(r rwWithUpgrade) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
hasContentLength := res.Header.Peek("Content-Length") != nil
|
||||
hasContentLength := len(res.Header.Peek("Content-Length")) > 0
|
||||
|
||||
if hasContentLength && res.Header.ContentLength() == 0 {
|
||||
return nil
|
||||
|
@ -307,8 +307,6 @@ func TestHeadRequest(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNoContentLengthResponse(t *testing.T) {
|
||||
t.Skip("Waiting for a fix")
|
||||
|
||||
backendListener, err := net.Listen("tcp", ":0")
|
||||
require.NoError(t, err)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user