Skip to content

Commit 96d95d4

Browse files
anandsureshMylesBorins
authored andcommitted
doc: minor fixes to http/2 docs
PR-URL: #14877 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent c0312dc commit 96d95d4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/api/http2.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ added: v8.4.0
192192
-->
193193

194194
The `'remoteSettings'` event is emitted when a new SETTINGS frame is received
195-
from the connected peer. When invoked, the handle function will receive a copy
195+
from the connected peer. When invoked, the handler function will receive a copy
196196
of the remote settings.
197197

198198
```js
@@ -1725,7 +1725,7 @@ those to lower-case (e.g. `content-type`) upon transmission.
17251725

17261726
Header field-names *must only* contain one or more of the following ASCII
17271727
characters: `a`-`z`, `A`-`Z`, `0`-`9`, `!`, `#`, `$`, `%`, `&`, `'`, `*`, `+`,
1728-
`-`, `.`, `^`, `_`, `` (backtick), `|`, and `~`.
1728+
`-`, `.`, `^`, `_`, `` ` `` (backtick), `|`, and `~`.
17291729

17301730
Using invalid characters within an HTTP header field name will cause the
17311731
stream to be closed with a protocol error being reported.
@@ -1883,12 +1883,12 @@ const server = createSecureServer(
18831883

18841884
function onRequest(req, res) {
18851885
// detects if it is a HTTPS request or HTTP/2
1886-
const { socket: { alpnProtocol } } = request.httpVersion === '2.0' ?
1887-
request.stream.session : request;
1888-
response.writeHead(200, { 'content-type': 'application/json' });
1889-
response.end(JSON.stringify({
1886+
const { socket: { alpnProtocol } } = req.httpVersion === '2.0' ?
1887+
req.stream.session : req;
1888+
res.writeHead(200, { 'content-type': 'application/json' });
1889+
res.end(JSON.stringify({
18901890
alpnProtocol,
1891-
httpVersion: request.httpVersion
1891+
httpVersion: req.httpVersion
18921892
}));
18931893
}
18941894
```

0 commit comments

Comments
 (0)