Skip to content

Commit

Permalink
doc: caution against removing pseudoheaders
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Nov 26, 2017
1 parent bb44626 commit 96cd258
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 96cd258

Please sign in to comment.