doc: url.format - true slash postfix behaviour
authorfansworld-claudio <cr@fansworld.tv>
Wed, 2 Dec 2015 17:58:50 +0000 (14:58 -0300)
committerMyles Borins <mborins@us.ibm.com>
Tue, 19 Jan 2016 19:52:17 +0000 (11:52 -0800)
Change url.format's references to slash postfixing to reflect
true behaviour (it only automatically postfixes slashes to the
slashedProtocols when host is present).

Fixes: #3361
PR-URL: https://github.com/nodejs/node/pull/4119
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
doc/api/url.markdown

index 8c8cd5bf1b85bfa4664f07d6282cf8057e528bcb..c6a4b2351b022748759a49263541b4a51fc50635 100644 (file)
@@ -87,12 +87,12 @@ Here's how the formatting process works:
 * `path` will be ignored.
 * `protocol` is treated the same with or without the trailing `:` (colon).
   * The protocols `http`, `https`, `ftp`, `gopher`, `file` will be
-    postfixed with `://` (colon-slash-slash).
+    postfixed with `://` (colon-slash-slash) as long as `host`/`hostname` are present.
   * 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/`.
+    slashes, such as `mongodb://localhost:8000/`, or if `host`/`hostname` are absent.
 * `auth` will be used if present.
 * `hostname` will only be used if `host` is absent.
 * `port` will only be used if `host` is absent.