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 headers order while sending them #1569
Comments
Also it think it should send (by default) Like it browsers do. Also it would more correct to prepend |
I have been planing to make a switch to a more standard/spec'ed implementation of the Header class and use fetch-headers instead... it will sort the headers when iteration over them. it also runs the test against WPT own test cases of making sure that it is up to spec. |
Yes, when a user code iterates a Keeping the headers order is required when a user want to make exactly the same requests as it do other libs, browsers. |
Bug
It sorts headers (except default
"Host"
one).Expected behavior
It should not sort the headers while sending them (while performing a network request).
Example
It sends (You can check it with a HTTP server that logs the input request headers)
Headers were sorted.
"host"
header were not sorted. (It keeps the append order.)Additional comment
If you want to simulate
Headers
object behavior you should sort the headers only when a user iterates through them, but not when you send the request.nodejs/undici#1309 (comment)
More over, not all headers were sorted (
"host"
that appends before sending, if you did not set it manually).It just makes a useless work (sorting).
Info
The text was updated successfully, but these errors were encountered: