mirror of https://github.com/sundowndev/http.git
fix: remove leading slash when using prefixUrl (#96)
parent
a6026cfb6b
commit
10fbd67966
|
@ -82,6 +82,9 @@ for (let method of ['get', 'head', 'delete', 'post', 'put', 'patch']) {
|
|||
|
||||
if (/^https?/.test(url)) {
|
||||
delete _options.prefixUrl
|
||||
} else if (_options.prefixUrl && typeof url === 'string' && url.startsWith('/')) {
|
||||
// Prevents `ky` from throwing "`input` must not begin with a slash when using `prefixUrl`"
|
||||
url = url.substr(1)
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue