Skip to content

Commit bd371d8

Browse files
Josh Gummersallandrewdeandrade
Josh Gummersall
authored andcommitted
doc: state url decoding behavior
Explicitly states the fact that no decoding is performed on the url path or pathname or the query string by default in the URL module. Fixes: nodejs/node#1538 PR-URL: nodejs/node#1731 Reviewed-By: Roman Reiss <[email protected]>
1 parent 2c5100b commit bd371d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/api/url.markdown

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ string will not be in the parsed object. Examples are shown for the URL
4141
Example: `'8080'`
4242

4343
* `pathname`: The path section of the URL, that comes after the host and
44-
before the query, including the initial slash if present.
44+
before the query, including the initial slash if present. No decoding is
45+
performed.
4546

4647
Example: `'/p/a/t/h'`
4748

@@ -50,7 +51,7 @@ string will not be in the parsed object. Examples are shown for the URL
5051

5152
Example: `'?query=string'`
5253

53-
* `path`: Concatenation of `pathname` and `search`.
54+
* `path`: Concatenation of `pathname` and `search`. No decoding is performed.
5455

5556
Example: `'/p/a/t/h?query=string'`
5657

@@ -72,7 +73,8 @@ Take a URL string, and return an object.
7273
Pass `true` as the second argument to also parse the query string using the
7374
`querystring` module. If `true` then the `query` property will always be
7475
assigned an object, and the `search` property will always be a (possibly
75-
empty) string. Defaults to `false`.
76+
empty) string. If `false` then the `query` property will not be parsed or
77+
decoded. Defaults to `false`.
7678

7779
Pass `true` as the third argument to treat `//foo/bar` as
7880
`{ host: 'foo', pathname: '/bar' }` rather than

0 commit comments

Comments
 (0)