-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
HTTP2 writehead header format can't use array of arrays for headers #24466
Comments
@nodejs/http2 |
I can confirm this diverging behaviour. However the documentation for
const http = require('http')
const http2 = require('http2')
const headers = [
[ 'Content-Type', 'text/html; charset=utf-8' ],
[ 'last-modified', 'Sun, 18 Nov 2018 17:49:47 GMT' ]
]
http.createServer((request, response) => {
console.log(`Request via HTTP/${request.httpVersion}`)
response.writeHead(200, headers)
response.end()
}).listen(8001)
http2.createServer((request, response) => {
console.log(`Request via HTTP/${request.httpVersion}`)
response.writeHead(200, headers)
response.end()
}).listen(8002)
|
Unfortunately, we probably should support it. |
writeHead supports an array of arrays containing header name and values. Compatibility between http2 & http1 even though this is not documented. Fixes: nodejs#24466
A suggestion: deprecate the nested array format starting off node 11after implementing parity. You can already achieve the same functionality trough the documented means, which is what I did. |
writeHead supports an array of arrays containing header name and values. Compatibility between http2 & http1 even though this is not documented. Fixes: #24466 PR-URL: #24665 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
writeHead supports an array of arrays containing header name and values. Compatibility between http2 & http1 even though this is not documented. Fixes: nodejs#24466 PR-URL: nodejs#24665 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
writeHead supports an array of arrays containing header name and values. Compatibility between http2 & http1 even though this is not documented. Fixes: #24466 PR-URL: #24665 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
writeHead supports an array of arrays containing header name and values. Compatibility between http2 & http1 even though this is not documented. Fixes: #24466 PR-URL: #24665 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
node 10.13
CentOs
HTTP2
With http, you can send headers like this:
[
[
"Content-Type",
"text/html; charset=utf-8"
],
[
"last-modified",
"Sun, 18 Nov 2018 17:49:47 GMT"
]
]
To send multiple values for the same header, like cookies. But with http2 the returned headers looks like this when this format is used:
https://i.imgur.com/QXZnu4v.png
The text was updated successfully, but these errors were encountered: