Skip to content

net/textproto: allows multi-line header field names #34702

Description

@katiehockman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions