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 2fb2289

Browse filesBrowse files
styfleItalo A. Casas
authored andcommitted
doc: add sub domain to host in url
PR-URL: #12233 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent ac200a6 commit 2fb2289
Copy full SHA for 2fb2289

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+33
-33
lines changed
Open diff view settings
Collapse file

β€Ždoc/api/url.mdβ€Ž

Copy file name to clipboardExpand all lines: doc/api/url.md
+33-33Lines changed: 33 additions & 33 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ When parsed, a URL object is returned containing properties for each of these
1616
components.
1717

1818
The following details each of the components of a parsed URL. The example
19-
`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` is used to
19+
`'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'` is used to
2020
illustrate each.
2121

2222
```txt
23-
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
24-
β”‚ href β”‚
25-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€
26-
β”‚ protocol β”‚β”‚ auth β”‚ host β”‚ path β”‚ hash β”‚
27-
β”‚ β”‚β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
28-
β”‚ β”‚β”‚ β”‚ hostname β”‚ port β”‚ pathname β”‚ search β”‚ β”‚
29-
β”‚ β”‚β”‚ β”‚ β”‚ β”‚ β”œβ”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
30-
β”‚ β”‚β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ query β”‚ β”‚
31-
" http: // user:pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
32-
β”‚ β”‚β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
33-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜
23+
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
24+
β”‚ href β”‚
25+
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€
26+
β”‚ protocol β”‚β”‚ auth β”‚ host β”‚ path β”‚ hash β”‚
27+
β”‚ β”‚β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
28+
β”‚ β”‚β”‚ β”‚ hostname β”‚ port β”‚ pathname β”‚ search β”‚ β”‚
29+
β”‚ β”‚β”‚ β”‚ β”‚ β”‚ β”œβ”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
30+
β”‚ β”‚β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ query β”‚ β”‚
31+
" http: // user:pass @ sub.host.com : 8080 /p/a/t/h ? query=string #hash "
32+
β”‚ β”‚β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
33+
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜
3434
(all spaces in the "" line should be ignored -- they are purely for formatting)
3535
```
3636

@@ -56,21 +56,21 @@ For example: `'#hash'`
5656
The `host` property is the full lower-cased host portion of the URL, including
5757
the `port` if specified.
5858

59-
For example: `'host.com:8080'`
59+
For example: `'sub.host.com:8080'`
6060

6161
### urlObject.hostname
6262

6363
The `hostname` property is the lower-cased host name portion of the `host`
6464
component *without* the `port` included.
6565

66-
For example: `'host.com'`
66+
For example: `'sub.host.com'`
6767

6868
### urlObject.href
6969

7070
The `href` property is the full URL string that was parsed with both the
7171
`protocol` and `host` components converted to lower-case.
7272

73-
For example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`
73+
For example: `'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`
7474

7575
### urlObject.path
7676

@@ -324,31 +324,31 @@ console.log(myURL.pathname); // /foo
324324
`delete myURL.pathname`, etc) has no effect but will still return `true`.
325325

326326
A comparison between this API and `url.parse()` is given below. Above the URL
327-
`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`, properties of an
327+
`'http://user:pass@sub.host.com:8080/p/a/t/h?query=string#hash'`, properties of an
328328
object returned by `url.parse()` are shown. Below it are properties of a WHATWG
329329
`URL` object.
330330

331331
*Note*: WHATWG URL's `origin` property includes `protocol` and `host`, but not
332332
`username` or `password`.
333333

334334
```txt
335-
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
336-
β”‚ href β”‚
337-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€
338-
β”‚ protocol β”‚ β”‚ auth β”‚ host β”‚ path β”‚ hash β”‚
339-
β”‚ β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
340-
β”‚ β”‚ β”‚ β”‚ hostname β”‚ port β”‚ pathname β”‚ search β”‚ β”‚
341-
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
342-
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ query β”‚ β”‚
343-
" http: // user : pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
344-
β”‚ β”‚ β”‚ β”‚ β”‚ hostname β”‚ port β”‚ β”‚ β”‚ β”‚
345-
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ β”‚
346-
β”‚ protocol β”‚ β”‚ username β”‚ password β”‚ host β”‚ β”‚ β”‚ β”‚
347-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ β”‚
348-
β”‚ origin β”‚ β”‚ origin β”‚ pathname β”‚ search β”‚ hash β”‚
349-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€
350-
β”‚ href β”‚
351-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
335+
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
336+
β”‚ href β”‚
337+
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€
338+
β”‚ protocol β”‚ β”‚ auth β”‚ host β”‚ path β”‚ hash β”‚
339+
β”‚ β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
340+
β”‚ β”‚ β”‚ β”‚ hostname β”‚ port β”‚ pathname β”‚ search β”‚ β”‚
341+
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
342+
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ query β”‚ β”‚
343+
" http: // user : pass @ sub.host.com : 8080 /p/a/t/h ? query=string #hash "
344+
β”‚ β”‚ β”‚ β”‚ β”‚ hostname β”‚ port β”‚ β”‚ β”‚ β”‚
345+
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ β”‚
346+
β”‚ protocol β”‚ β”‚ username β”‚ password β”‚ host β”‚ β”‚ β”‚ β”‚
347+
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ β”‚
348+
β”‚ origin β”‚ β”‚ origin β”‚ pathname β”‚ search β”‚ hash β”‚
349+
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€
350+
β”‚ href β”‚
351+
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
352352
(all spaces in the "" line should be ignored -- they are purely for formatting)
353353
```
354354

0 commit comments

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