diff options
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 |