Rule for the base URL: an absolute http:/https: URL, spelled http(s):// and the host,
with no query or fragment, no backslash, no surrounding whitespace, and no % in the
userinfo that doesn't start an escape (%25 for a literal one: the engine percent-decodes
it for the Authorization header). Request paths are appended to it as a string, so a ? or
# would swallow every path. WHATWG reads a \ in an http(s) URL as /, so it ends the
host (https://u:pw@a.example@b.example is a.example), and it repairs http:host,
http:/host and http:///host silently into http://host: every reader of the base URL
has to agree where its host is, so both are refused. new URL() trims surrounding
whitespace silently ("https://h/ " would have requested /%20/api/v2/...).
Rule for the base URL: an absolute
http:/https:URL, spelledhttp(s)://and the host, with no query or fragment, no backslash, no surrounding whitespace, and no%in the userinfo that doesn't start an escape (%25for a literal one: the engine percent-decodes it for the Authorization header). Request paths are appended to it as a string, so a?or#would swallow every path. WHATWG reads a\in an http(s) URL as/, so it ends the host (https://u:pw@a.example@b.exampleis a.example), and it repairshttp:host,http:/hostandhttp:///hostsilently intohttp://host: every reader of the base URL has to agree where its host is, so both are refused.new URL()trims surrounding whitespace silently ("https://h/ "would have requested/%20/api/v2/...).