From 711a356468da99d8f021cde6e6ca3ac92bd67c75 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 17 Aug 2011 13:13:56 -0700 Subject: [PATCH] Close #1544 Document slashesDenoteHost flag in url.parse --- doc/api/url.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/api/url.markdown b/doc/api/url.markdown index ac5b1444a30..428b51d9011 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -42,11 +42,17 @@ string will not be in the parsed object. Examples are shown for the URL The following methods are provided by the URL module: -### url.parse(urlStr, parseQueryString=false) +### url.parse(urlStr, parseQueryString=false, slashesDenoteHost=false) -Take a URL string, and return an object. Pass `true` as the second argument to also parse +Take a URL string, and return an object. + +Pass `true` as the second argument to also parse the query string using the `querystring` module. +Pass `true` as the third argument to treat `//foo/bar` as +`{ host: 'foo', pathname: '/bar' }` rather than +`{ pathname: '//foo/bar' }`. + ### url.format(urlObj) Take a parsed URL object, and return a formatted URL string.