diff options
author | Alba Mendez <me@alba.sh> | 2020-08-07 12:54:08 +0200 |
---|---|---|
committer | Alba Mendez <me@alba.sh> | 2020-08-17 13:49:59 +0200 |
commit | f5c0e282ccf98e17f295c11850649ad19a6fff51 (patch) | |
tree | ba580ab119454eee33c3d0aa18968008d7ad2a31 /src/node_http2.cc | |
parent | 42a3a7f97d3b565763671047c774c858c1e0d5c1 (diff) | |
download | node-new-f5c0e282ccf98e17f295c11850649ad19a6fff51.tar.gz |
http2: allow Host in HTTP/2 requests
The HTTP/2 spec allows Host to be used instead of :authority in
requests, and this is in fact *preferred* when converting from HTTP/1.
We erroneously treated Host as a connection header, thus disallowing
it in requests. The patch corrects this, aligning Node.js behaviour
with the HTTP/2 spec and with nghttp2:
- Treat Host as a single-value header instead of a connection header.
- Don't autofill :authority if Host is present.
- The compatibility API (request.authority) falls back to using Host
if :authority is not present.
This is semver-major because requests are no longer guaranteed to
have :authority set. An explanatory note was added to the docs.
Fixes: https://github.com/nodejs/node/issues/29858
PR-URL: https://github.com/nodejs/node/pull/34664
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Diffstat (limited to 'src/node_http2.cc')
0 files changed, 0 insertions, 0 deletions