Skip to content

Commit

Permalink
doc: wrap message.url description at 80 characters
Browse files Browse the repository at this point in the history
Wrapped at 80 characters and refactored.

Fixes: nodejs#30048
Refs: nodejs#30830
  • Loading branch information
saitolume committed Dec 8, 2019
1 parent 8f76b05 commit 3efb569
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1973,13 +1973,14 @@ Accept: text/plain\r\n
\r\n
```

To parse the url into its parts The WHATWG URL API can be used:
To parse the URL into its parts:

```js
new URL(request.url, `http://${request.headers.host}`);
```

When `request.url` is `'/status?name=ryan'` and `request.headers.host` is `'localhost:3000'`:
When `request.url` is `'/status?name=ryan'` and
`request.headers.host` is `'localhost:3000'`:

```console
$ node
Expand Down

0 comments on commit 3efb569

Please sign in to comment.