summaryrefslogtreecommitdiff
path: root/doc/api/url.markdown
diff options
context:
space:
mode:
authorGabriel Wicke <wicke@wikidev.net>2014-09-25 09:59:18 -0700
committerTrevor Norris <trev.norris@gmail.com>2014-10-01 12:23:01 -0700
commitb705b73e46193c7691be40b732330a49affacedb (patch)
tree9c02144948715fcb0b38ab379cea386d3438d609 /doc/api/url.markdown
parentac2857b12cd819b68405b15c3f8e95e48bcc32d8 (diff)
downloadnode-new-b705b73e46193c7691be40b732330a49affacedb.tar.gz
url: make query() consistent
Match the behavior of the slow path by setting url.query to an empty object when the url contains no query, but query parsing is requested. Also add a test for this case, and update the documents to clearly reflect this behavior. Fixes: https://github.com/joyent/node/issues/8332 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'doc/api/url.markdown')
-rw-r--r--doc/api/url.markdown7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/api/url.markdown b/doc/api/url.markdown
index e6a43f72bc..6b8ff9d507 100644
--- a/doc/api/url.markdown
+++ b/doc/api/url.markdown
@@ -69,9 +69,10 @@ The following methods are provided by the URL module:
Take a URL string, and return an object.
-Pass `true` as the second argument to also parse
-the query string using the `querystring` module.
-Defaults to `false`.
+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`.
Pass `true` as the third argument to treat `//foo/bar` as
`{ host: 'foo', pathname: '/bar' }` rather than