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

Keep the order of the handshake headers #207

Open
64chevy opened this issue Dec 19, 2024 · 3 comments
Open

Keep the order of the handshake headers #207

64chevy opened this issue Dec 19, 2024 · 3 comments
Labels

Comments

@64chevy
Copy link

64chevy commented Dec 19, 2024

Is there no way to maintain the order of the handshake headers? Some applications are strict to check the order of the headers

@cristaloleg
Copy link
Collaborator

Can you clarify exactly why and what headers you want to keep ordered?

@64chevy
Copy link
Author

64chevy commented Dec 19, 2024

Can you clarify exactly why and what headers you want to keep ordered?

When making an api which connects to a server to receive socket messages. The header i am talking about is the handshake headers, its just sent once but the server I send it to can detect the order.

Using http.Header shuffles the dict.

@cristaloleg
Copy link
Collaborator

http.Header uses Go map underneath. It doesn't keep preserve order (for safety reasons mostly).

However, it's declaration looks like type Header map[string][]string (https://pkg.go.dev/net/http#Header) where values are a slice. Not sure is it related to your code somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants