| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The current behavior is intentional and what you're proposing would be significantly backwards incompatible. What's the motivation for the change? |
Sorry, something went wrong.
|
use setHeader before(or not) writeHead will produce different results res.setHeader('x', 'y');
res.writeHead(200, {
'aa': 'a1',
'aA': 'a2'
});get aA: a2 x: y And res.writeHead(200, {
'aa': 'a1',
'aA': 'a2'
});will get aA: a2 aa: a1 |
Sorry, something went wrong.
|
I'd say if the user wants to try and send the same-case headers (a and A are equivalent in HTTP), it isn't worth it to stop them at the expense of the extra CPU runs and perf cost. |
Sorry, something went wrong.
|
I wonder if the opposite wouldn't be more useful? It'd be speedier for sure, and it is also the more common case. (i.e. something set headers before writeHead.) Ultimately HTTP still needs the eventual re-write isaacs was once planning to do. |
Sorry, something went wrong.
|
If we're changing functionality, this should error: res.writeHead(200, {
'X-BAR': 'foo',
'x-bar': 'baz'
});After all, objects are unordered and we can't decide whether to send foo or baz in this case. Therefor, though I don't advocate throwing an error in this case, I think it'd be better than this change. I'll close this unless someone disagrees. |
Sorry, something went wrong.
|
Closing - if you feel that this wasn't discussed fully, this can always be re-opened. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
No description provided.