From e8e8ce21d5d5b0d32665fe12eaa434c84411abcd Mon Sep 17 00:00:00 2001 From: Gregor Noczinski Date: Thu, 28 May 2020 11:33:52 +0200 Subject: [PATCH] `chunked` encoding should also enforce the `TransferEncoding` and `ContentLength` --- proxy/encoding.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/encoding.go b/proxy/encoding.go index e41574c..4079ddd 100644 --- a/proxy/encoding.go +++ b/proxy/encoding.go @@ -4,6 +4,7 @@ import ( "github.com/echocat/lingress/context" "github.com/echocat/lingress/rules" "github.com/echocat/lingress/support" + "net/textproto" "strings" ) @@ -46,6 +47,7 @@ func (instance *Encoding) handleRequest(ctx *context.Context) (proceed bool, err if r := ctx.Rule; r != nil { if v := rules.OptionsEncodingOf(r.Options()).TransportEncoding; len(v) > 0 { req.TransferEncoding = v + req.Header[textproto.CanonicalMIMEHeaderKey("Transfer-Encoding")] = v for _, p := range v { if strings.ToLower(p) == "chunked" { req.ContentLength = -1