Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0acd91

Browse filesBrowse files
jasnellMylesBorins
authored andcommitted
doc: caution against removing pseudoheaders
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>
1 parent 63f6947 commit a0acd91
Copy full SHA for a0acd91

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/http2.md‎

Copy file name to clipboardExpand all lines: doc/api/http2.md
+12Lines changed: 12 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2127,6 +2127,18 @@ console.log(request.headers);
21272127

21282128
See [Headers Object][].
21292129

2130+
*Note*: In HTTP/2, the request path, host name, protocol, and method are
2131+
represented as special headers prefixed with the `:` character (e.g. `':path'`).
2132+
These special headers will be included in the `request.headers` object. Care
2133+
must be taken not to inadvertently modify these special headers or errors may
2134+
occur. For instance, removing all headers from the request will cause errors
2135+
to occur:
2136+
2137+
```js
2138+
removeAllHeaders(request.headers);
2139+
assert(request.url); // Fails because the :path header has been removed
2140+
```
2141+
21302142
#### request.httpVersion
21312143
<!-- YAML
21322144
added: v8.4.0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.