Skip to content

Commit

Permalink
doc: caution against removing pseudoheaders
Browse files Browse the repository at this point in the history
PR-URL: #17329
Fixes: #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>
  • Loading branch information
jasnell authored and MylesBorins committed Dec 12, 2017
1 parent 63f6947 commit a0acd91
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0acd91

Please sign in to comment.