A base URL must be an absolute http:/https: URL without a query or fragment,
and without whitespace or control characters. new URL() trims surrounding
whitespace and drops tab/CR/LF silently, so the raw string is checked rather
than the parsed one; request paths are appended to the base's path as text, so
a ? or # would swallow them and every call would fetch the base URL itself.
Userinfo (user:pw@) is allowed, and redacted in messages; a % in it must start a
valid escape (%25 for a literal one), as Node decodes it for the Authorization header.
A backslash is refused (WHATWG reads it as "/" in an http(s) URL, so it ends the host, where
a reader of the text would not), and so is a scheme not followed by exactly // and the host
(http:host, http:/host, http:///host), which WHATWG repairs silently into another host
than the one typed. The engine requests the base URL as WHATWG parses it. The reasons never
repeat the value, nor a part of it: a scheme is named (Unsupported scheme "ftp:") only when
the value spells one (<scheme>://), since a scheme-less user:password@host parses with the
user name as its scheme.
A base URL must be an absolute
http:/https:URL without a query or fragment, and without whitespace or control characters.new URL()trims surrounding whitespace and drops tab/CR/LF silently, so the raw string is checked rather than the parsed one; request paths are appended to the base's path as text, so a?or#would swallow them and every call would fetch the base URL itself. Userinfo (user:pw@) is allowed, and redacted in messages; a%in it must start a valid escape (%25for a literal one), as Node decodes it for the Authorization header. A backslash is refused (WHATWG reads it as "/" in an http(s) URL, so it ends the host, where a reader of the text would not), and so is a scheme not followed by exactly//and the host (http:host,http:/host,http:///host), which WHATWG repairs silently into another host than the one typed. The engine requests the base URL as WHATWG parses it. The reasons never repeat the value, nor a part of it: a scheme is named (Unsupported scheme "ftp:") only when the value spells one (<scheme>://), since a scheme-lessuser:password@hostparses with the user name as its scheme.