Skip to content

net/textproto: fails when headers contain invalid headers #53855

Description

@kayrus

What version of Go are you using (go version)?

$ go version
go version go1.18.3 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

See example: https://go.dev/play/p/OLfq5WlWCMf (with a fake UTF colon)

What did you expect to see?

I expect that textproto.ReadMIMEHeader will return parsed headers, skip failed headers and return an error if any along with parsed headers:

Read headers: map[Date:[Mon, 23 Jun 2015 11:40:36 -0400] Subject:[Gophers at Gophercon] To:[Another Gopher <to@example.com>]]

What did you see instead?

I see only first parsed header: Date:[Mon, 23 Jun 2015 11:40:36 -0400]

Further headers are not parsed.

See also: #53854

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions