aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2022-06-06 13:54:22 -0700
committerDamien Neil <dneil@google.com>2022-11-08 20:36:15 +0000
commita6642e67e16b9d769a0c08e486ba08408064df19 (patch)
tree6d861b0026ebdaf5c58ce57086aef37480470d19 /src/net/http
parent41be62e168fa7de2cf3357ad32f7105377bfd758 (diff)
downloadgo-a6642e67e16b9d769a0c08e486ba08408064df19.tar.xz
net/textproto: reject invalid header keys/values in ReadMIMEHeader
Return an error when parsing a MIME header containing bytes in the key or value outside the set allowed by RFC 7230. For historical compatibility, accept spaces in keys (but do not canonicalize the key in this case). For #53188. Change-Id: I195319362a2fc69c4e506644f78c5026db070379 Reviewed-on: https://go-review.googlesource.com/c/go/+/410714 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/net/http')
-rw-r--r--src/net/http/serve_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go
index a93f6eff1b..b6853182bf 100644
--- a/src/net/http/serve_test.go
+++ b/src/net/http/serve_test.go
@@ -6165,7 +6165,7 @@ func testUnsupportedTransferEncodingsReturn501(t *testing.T, mode testMode) {
"fugazi",
"foo-bar",
"unknown",
- "\rchunked",
+ `" chunked"`,
}
for _, badTE := range unsupportedTEs {