Reported by @empijei
Go supports multiline headers with the obsolete leading whitespace syntax as described in RPC 7230 3.2.3 and 3.2.4. This is acceptable for header field values as long as servers "replace each received obs-fold with one or more SP octets prior to interpreting the field value or forwarding the message downstream"
However, this behavior also occurs with header field names, which isn't specified in any RFC and is likely an over-extension of HTTP parsing rules. In other words, the following is allowed, and resolves to Gopher-New- Line:
GET /path HTTP/1.1
Host: golang.org
Gopher-New-
Line: This is a header on multiple lines
Content-Type: application/goroutines
Servers should reject requests with a field-name containing whitespace.
/cc @bradfitz @FiloSottile
Reported by @empijei
Go supports multiline headers with the obsolete leading whitespace syntax as described in RPC 7230 3.2.3 and 3.2.4. This is acceptable for header field values as long as servers "replace each received obs-fold with one or more SP octets prior to interpreting the field value or forwarding the message downstream"
However, this behavior also occurs with header field names, which isn't specified in any RFC and is likely an over-extension of HTTP parsing rules. In other words, the following is allowed, and resolves to
Gopher-New- Line:Servers should reject requests with a field-name containing whitespace.
/cc @bradfitz @FiloSottile