Skip to content

net/http: header.WriteSubset is case sensitive #34918

Closed
@empijei

Description

@empijei

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

$ go version
go version devel +0e015e20cf Wed Sep 11 12:26:35 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Not relevant

What did you do?

https://play.golang.org/p/gtm6ZUm4omF

	h := http.Header{}
	exclude := map[string]bool{}
	for k, v := range headers {
		h.Add(k, v)
		exclude[k] = true
	}
	h.WriteSubset(os.Stdout, exclude)

What did you expect to see?

Nothing

What did you see instead?

All lowercase headers

Notes

I think this should either be documented or fixed as WriteSubset is the only method for http.Header that does not perform canonicalization.

/cc @bradfitz @rsc as per https://dev.golang.org/owners
/cc @kele as we found this together

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions