summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYazhong Liu <l900422@vip.qq.com>2014-05-07 18:59:23 +0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-05-22 09:27:03 -0700
commite86c9421ef688c513c2b5f4cc32170f41b12e6fa (patch)
tree541377872e5b49f392f4404432279d0114a55c8d
parent31150df92a5c5e726a4aa12b78a2589e7b20f1ec (diff)
downloadnode-e86c9421ef688c513c2b5f4cc32170f41b12e6fa.tar.gz
doc: document url `slashes` property
Slashes should be documented, because 3rd-party protocols -- those postfixed with `://` -- would incorrectly `format` and `parse` if they didn't set/get the `slashes` option. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
-rw-r--r--doc/api/url.markdown7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/url.markdown b/doc/api/url.markdown
index ffb224384..6aa6863ec 100644
--- a/doc/api/url.markdown
+++ b/doc/api/url.markdown
@@ -19,6 +19,10 @@ string will not be in the parsed object. Examples are shown for the URL
Example: `'http:'`
+* `slashes`: The protocol requires slashes after the colon
+
+ Example: true or false
+
* `host`: The full lowercased host portion of the URL, including port
information.
@@ -83,6 +87,9 @@ Take a parsed URL object, and return a formatted URL string.
postfixed with `://` (colon-slash-slash).
* All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will
be postfixed with `:` (colon)
+* `slashes` set to `true` if the protocol requires `://` (colon-slash-slash)
+ * Only needs to be set for protocols not previously listed as requiring
+ slashes, such as `mongodb://localhost:8000/`
* `auth` will be used if present.
* `hostname` will only be used if `host` is absent.
* `port` will only be used if `host` is absent.