doc: fix example of parsing request.url

PR-URL: https://github.com/nodejs/node/pull/31302
Fixes: https://github.com/nodejs/node/issues/31301
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Egor Pavlov
2020-01-10 21:06:18 +03:00
committed by Ruben Bridgewater
parent c643e3b572
commit fff75645e9

View File

@@ -1990,7 +1990,7 @@ When `request.url` is `'/status?name=ryan'` and
```console
$ node
> new URL(request.url, request.headers.host)
> new URL(request.url, `http://${request.headers.host}`)
URL {
href: 'http://localhost:3000/status?name=ryan',
origin: 'http://localhost:3000',