A rule for a configured base URL: a non-blank, well-formed http:/https: URL
with no query, fragment, backslash or surrounding whitespace, its scheme followed by
exactly // and the host. Request paths are appended to the base URL, so a ? or #
would swallow every path (http://h/fs?x=1 requests /fs?x=1/0/query?..., http://h/fs#f
requests /fs with no parameters), and surrounding whitespace, which new URL() trims
silently, means the URL requested is not the one typed. WHATWG ends an http(s) host at a
backslash, as at a /, while text-based code reads on, so https://u:pw@a.example\@b.example
would be checked as one host and its credentials sent to another; and it skips any slashes
after http: and repairs http:host, http:/host and http:///host into http://host
silently: both are refused. A % in the user name or password must start a valid escape
(%25 for a literal one). The reasons never echo the value, nor a part of it, so a
credential in it cannot leak into a message.
A rule for a configured base URL: a non-blank, well-formed
http:/https:URL with no query, fragment, backslash or surrounding whitespace, its scheme followed by exactly//and the host. Request paths are appended to the base URL, so a?or#would swallow every path (http://h/fs?x=1requests/fs?x=1/0/query?...,http://h/fs#frequests/fswith no parameters), and surrounding whitespace, whichnew URL()trims silently, means the URL requested is not the one typed. WHATWG ends an http(s) host at a backslash, as at a/, while text-based code reads on, sohttps://u:pw@a.example\@b.examplewould be checked as one host and its credentials sent to another; and it skips any slashes afterhttp:and repairshttp:host,http:/hostandhttp:///hostintohttp://hostsilently: both are refused. A%in the user name or password must start a valid escape (%25for a literal one). The reasons never echo the value, nor a part of it, so a credential in it cannot leak into a message.