Skip to content

Commit

Permalink
chunked encoding should also enforce the TransferEncoding and `Co…
Browse files Browse the repository at this point in the history
…ntentLength`
  • Loading branch information
blaubaer committed May 28, 2020
1 parent 80b79ca commit e8e8ce2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proxy/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/echocat/lingress/context"
"github.com/echocat/lingress/rules"
"github.com/echocat/lingress/support"
"net/textproto"
"strings"
)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8e8ce2

Please sign in to comment.