From 2a29b70b37d2886bc5b7e3721c8fecec00e18e10 Mon Sep 17 00:00:00 2001 From: fansworld-claudio Date: Wed, 2 Dec 2015 14:58:50 -0300 Subject: [PATCH] doc: url.format - true slash postfix behaviour 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 Reviewed-By: Roman Reiss Reviewed-By: Minwoo Jung --- 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 8c8cd5bf1b85bf..c6a4b2351b0227 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -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.