From 6ee757dfef1e784d5f27c419829f9cb7b3d2c601 Mon Sep 17 00:00:00 2001 From: Josh Gummersall Date: Mon, 18 May 2015 21:35:48 -0700 Subject: [PATCH 1/2] docs: state decoding behavior for url pathname 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 https://github.com/nodejs/io.js/issues/1538 --- doc/api/url.markdown | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api/url.markdown b/doc/api/url.markdown index 3931e8d08e13a0..fc486a18fedb3e 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -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'` @@ -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'` @@ -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 neither the `query` nor the `search` +properties will be parsed or decoded. Defaults to `false`. Pass `true` as the third argument to treat `//foo/bar` as `{ host: 'foo', pathname: '/bar' }` rather than From 202779b6929870032d7b6f3628fb9adabe45aa95 Mon Sep 17 00:00:00 2001 From: Josh Gummersall Date: Sun, 24 May 2015 19:26:58 -0700 Subject: [PATCH 2/2] Fix grammar error and clarify `search` handling --- doc/api/url.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/url.markdown b/doc/api/url.markdown index fc486a18fedb3e..8626a073144cbc 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -73,8 +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. If `false` then the neither the `query` nor the `search` -properties will be parsed or decoded. 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