]> Cypherpunks repositories - gostls13.git/commitdiff
net/textproto: document enforcement of RFC 9112 for headers
authorSean Liao <sean@liao.dev>
Sat, 27 Jul 2024 08:15:31 +0000 (09:15 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 4 Mar 2025 06:12:55 +0000 (22:12 -0800)
Fixes #68590

Change-Id: Ie7cf1fe8379182f86317d5ebb7f45a404ecd70e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/601555
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/net/textproto/reader.go
src/net/textproto/textproto.go

index f98e05bd1d86af4d64949f8e014792428db83dce..d375340121fa0b7d72e63330741d7eef76f3be5c 100644 (file)
@@ -642,8 +642,8 @@ func (r *Reader) upcomingHeaderKeys() (n int) {
 // the rest are converted to lowercase. For example, the
 // canonical key for "accept-encoding" is "Accept-Encoding".
 // MIME header keys are assumed to be ASCII only.
-// If s contains a space or invalid header field bytes, it is
-// returned without modifications.
+// If s contains a space or invalid header field bytes as
+// defined by RFC 9112, it is returned without modifications.
 func CanonicalMIMEHeaderKey(s string) string {
        // Quick check for canonical encoding.
        upper := true
index 4ae3ecff747093ce5b1ea4cc711c68351e48d2ab..00dc8cbee52b4899fdb357ae2dca84afb0857777 100644 (file)
@@ -5,6 +5,9 @@
 // Package textproto implements generic support for text-based request/response
 // protocols in the style of HTTP, NNTP, and SMTP.
 //
+// This package enforces the HTTP/1.1 character set defined by
+// RFC 9112 for header keys and values.
+//
 // The package provides:
 //
 // [Error], which represents a numeric error response from