Skip to content

Commit

Permalink
doc: state url decoding behavior
Browse files Browse the repository at this point in the history
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: #1538
PR-URL: #1731
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
Josh Gummersall authored and silverwind committed May 25, 2015
1 parent 1eec5f0 commit a74c2c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/api/url.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ string will not be in the parsed object. Examples are shown for the URL
Example: `'8080'`

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

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

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

Example: `'?query=string'`

* `path`: Concatenation of `pathname` and `search`.
* `path`: Concatenation of `pathname` and `search`. No decoding is performed.

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

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

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

0 comments on commit a74c2c9

Please sign in to comment.