-
-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Labels
bugSomething does not work as it shouldSomething does not work as it shouldregressionSomething does not work anymoreSomething does not work anymore✭ help wanted ✭
Description
As per the readme:
Note: Leading slashes in input are disallowed when using this option to enforce consistency and avoid confusion. For example, when the prefix URL is https://example.com/foo and the input is /bar, there's ambiguity whether the resulting URL would become https://example.com/foo/bar or https://example.com/bar. The latter is used by browsers.
But it does not throw:
got/source/normalize-arguments.ts
Lines 303 to 319 in 3c6ca29
if (is.string(options.url)) { | |
options.url = (options.prefixUrl as string) + options.url; | |
options.url = options.url.replace(/^unix:/, 'http://$&'); | |
if (options.searchParams || options.search) { | |
options.url = options.url.split('?')[0]; | |
} | |
// @ts-ignore URL is not URL | |
options.url = optionsToUrl({ | |
origin: options.url, | |
...options | |
}); | |
} else if (!is.urlInstance(options.url)) { | |
// @ts-ignore URL is not URL | |
options.url = optionsToUrl({origin: options.prefixUrl as string, ...options}); | |
} |
Metadata
Metadata
Assignees
Labels
bugSomething does not work as it shouldSomething does not work as it shouldregressionSomething does not work anymoreSomething does not work anymore✭ help wanted ✭