Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: http header fields order #19292

Closed
ddo opened this issue Feb 26, 2017 · 4 comments
Closed

proposal: http header fields order #19292

ddo opened this issue Feb 26, 2017 · 4 comments

Comments

@ddo
Copy link

ddo commented Feb 26, 2017

Since Go http headers is store in a map and in Go 1 the runtime randomizes map iteration, so:

  • we need a way to let people define the order.
  • or at least Go set the default order by "good practice" as defined in RFC 2616, section 4.2:
The order in which header fields with differing field names are
received is not significant. However, it is "good practice" to send
general-header fields first, followed by request-header or response-
header fields, and ending with the entity-header fields.
@mvdan
Copy link
Member

mvdan commented Feb 26, 2017

Is there anything in particular this would fix or help with, other than satisfying the RFC good practice?

cc @bradfitz

@bradfitz bradfitz added this to the Proposal milestone Feb 26, 2017
@bradfitz
Copy link
Contributor

Yeah, what @mvdan said. But even that RFC text can be implemented without knowing the "original" order. I'd like to see evidence that anybody cares about the order before we even did that, though. I'd need a lot of evidence that order matters to somebody before adding new API around this.

@ddo
Copy link
Author

ddo commented Feb 26, 2017

There are many cases i guess.

Set-Cookie: cookie1=1
Set-Cookie: cookie1=2

cookie1 will be set to 2 if in order

Accept: text/plain
Accept: text/html

equivalent to Accept: text/plain, text/html, but not equivalent to Accept: text/html, text/plain.

@bradfitz
Copy link
Contributor

There are many cases i guess.

Okay, it sounds like there's no concrete problem if we're guessing at hypotheticals here.

Neither of those Set-Cookie or Accept cases are problematic. We already preserve the order of multiple values for header fields.

I'm going to close this until a concrete problem is identified.

@golang golang locked and limited conversation to collaborators Feb 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants