diff options
author | James M Snell <jasnell@gmail.com> | 2017-11-26 11:12:03 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-11-27 12:05:50 -0800 |
commit | cc7fe6032163d6980cef949b3eb854993c228a8f (patch) | |
tree | 441efb35a6dfea0e66d560d867af35a883914436 /doc | |
parent | 4ca4db0d4cd5eb3e7eb0dafdfef9ee3e9d091e0d (diff) | |
download | node-new-cc7fe6032163d6980cef949b3eb854993c228a8f.tar.gz |
doc: caution against removing pseudoheaders
PR-URL: https://github.com/nodejs/node/pull/17329
Fixes: https://github.com/nodejs/node/issues/15312
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/http2.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md index 3500c563a2..ec3cef8aa0 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2127,6 +2127,18 @@ console.log(request.headers); See [Headers Object][]. +*Note*: In HTTP/2, the request path, host name, protocol, and method are +represented as special headers prefixed with the `:` character (e.g. `':path'`). +These special headers will be included in the `request.headers` object. Care +must be taken not to inadvertently modify these special headers or errors may +occur. For instance, removing all headers from the request will cause errors +to occur: + +```js +removeAllHeaders(request.headers); +assert(request.url); // Fails because the :path header has been removed +``` + #### request.httpVersion <!-- YAML added: v8.4.0 |