Skip to content

Commit 3b9d10c

Browse files
seankhliaogopherbot
authored andcommitted
net/textproto: document enforcement of RFC 9112 for headers
Fixes #68590 Change-Id: Ie7cf1fe8379182f86317d5ebb7f45a404ecd70e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/601555 Auto-Submit: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 2ce1fb4 commit 3b9d10c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/net/textproto/reader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,8 @@ func (r *Reader) upcomingHeaderKeys() (n int) {
642642
// the rest are converted to lowercase. For example, the
643643
// canonical key for "accept-encoding" is "Accept-Encoding".
644644
// MIME header keys are assumed to be ASCII only.
645-
// If s contains a space or invalid header field bytes, it is
646-
// returned without modifications.
645+
// If s contains a space or invalid header field bytes as
646+
// defined by RFC 9112, it is returned without modifications.
647647
func CanonicalMIMEHeaderKey(s string) string {
648648
// Quick check for canonical encoding.
649649
upper := true

src/net/textproto/textproto.go

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// Package textproto implements generic support for text-based request/response
66
// protocols in the style of HTTP, NNTP, and SMTP.
77
//
8+
// This package enforces the HTTP/1.1 character set defined by
9+
// RFC 9112 for header keys and values.
10+
//
811
// The package provides:
912
//
1013
// [Error], which represents a numeric error response from

0 commit comments

Comments
 (0)