Browse Source

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>
v0.10.29-release
Yazhong Liu 11 years ago
committed by Timothy J Fontaine
parent
commit
e86c9421ef
  1. 7
      doc/api/url.markdown

7
doc/api/url.markdown

@ -19,6 +19,10 @@ string will not be in the parsed object. Examples are shown for the URL
Example: `'http:'` 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 * `host`: The full lowercased host portion of the URL, including port
information. information.
@ -83,6 +87,9 @@ Take a parsed URL object, and return a formatted URL string.
postfixed with `://` (colon-slash-slash). postfixed with `://` (colon-slash-slash).
* All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will * All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will
be postfixed with `:` (colon) 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. * `auth` will be used if present.
* `hostname` will only be used if `host` is absent. * `hostname` will only be used if `host` is absent.
* `port` will only be used if `host` is absent. * `port` will only be used if `host` is absent.

Loading…
Cancel
Save