http: ensure writeHead not set repeated header#1284
http: ensure writeHead not set repeated header#1284haoxins wants to merge 1 commit intonodejs:v1.xfrom haoxins:write-head-consistency
Conversation
|
The current behavior is intentional and what you're proposing would be significantly backwards incompatible. What's the motivation for the change? |
|
use res.setHeader('x', 'y');
res.writeHead(200, {
'aa': 'a1',
'aA': 'a2'
});get And res.writeHead(200, {
'aa': 'a1',
'aA': 'a2'
});will get |
|
I'd say if the user wants to try and send the same-case headers ( |
|
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 Ultimately HTTP still needs the eventual re-write isaacs was once planning to do. |
|
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 I'll close this unless someone disagrees. |
|
Closing - if you feel that this wasn't discussed fully, this can always be re-opened. |
No description provided.