| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 63f6947 commit a0acd91
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2127,6 +2127,18 @@ console.log(request.headers); | |||
| 2127 | 2127 | ||
| 2128 | 2128 | See [Headers Object][]. | |
| 2129 | 2129 | ||
| 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 | + | ||
| 2130 | 2142 | #### request.httpVersion | |
| 2131 | 2143 | <!-- YAML | |
| 2132 | 2144 | added: v8.4.0 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments