Skip to content

Commit

Permalink
[go1.15] apimachinery/pkg/util/proxy: Drop identity transfer-encoding
Browse files Browse the repository at this point in the history
ref: https://tip.golang.org/doc/go1.15#net/http

Parsing is now stricter as a hardening measure against request smuggling
attacks: non-ASCII white space is no longer trimmed like SP and HTAB,
and support for the "identity" Transfer-Encoding was dropped.

Signed-off-by: Stephen Augustus <saugustus@vmware.com>
  • Loading branch information
justaugustus committed Jul 25, 2020
1 parent 05ffc95 commit 1171ae7
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,21 +763,6 @@ func TestProxyRequestContentLengthAndTransferEncoding(t *testing.T) {
expectedBody: sampleData,
},

"content-length + identity transfer-encoding": {
reqHeaders: http.Header{
"Content-Length": []string{"5"},
"Transfer-Encoding": []string{"identity"},
},
reqBody: sampleData,

expectedHeaders: http.Header{
"Content-Length": []string{"5"},
"Content-Encoding": nil, // none set
"Transfer-Encoding": nil, // gets removed
},
expectedBody: sampleData,
},

"content-length + gzip content-encoding": {
reqHeaders: http.Header{
"Content-Length": []string{strconv.Itoa(len(zip(sampleData)))},
Expand Down

0 comments on commit 1171ae7

Please sign in to comment.