Skip to content

Commit 2a29b70

Browse files
fansworld-claudioJungMinu
fansworld-claudio
authored andcommitted
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: #4119 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent f8cf947 commit 2a29b70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/url.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ Here's how the formatting process works:
8787
* `path` will be ignored.
8888
* `protocol` is treated the same with or without the trailing `:` (colon).
8989
* The protocols `http`, `https`, `ftp`, `gopher`, `file` will be
90-
postfixed with `://` (colon-slash-slash).
90+
postfixed with `://` (colon-slash-slash) as long as `host`/`hostname` are present.
9191
* All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will
9292
be postfixed with `:` (colon).
9393
* `slashes` set to `true` if the protocol requires `://` (colon-slash-slash)
9494
* Only needs to be set for protocols not previously listed as requiring
95-
slashes, such as `mongodb://localhost:8000/`.
95+
slashes, such as `mongodb://localhost:8000/`, or if `host`/`hostname` are absent.
9696
* `auth` will be used if present.
9797
* `hostname` will only be used if `host` is absent.
9898
* `port` will only be used if `host` is absent.

0 commit comments

Comments
 (0)