mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
fix(http): treat http://localhost as base URL for relative paths to avoid ERR_INVALID_URL error; (#5528)
This commit is contained in:
@@ -183,7 +183,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
||||
|
||||
// Parse url
|
||||
const fullPath = buildFullPath(config.baseURL, config.url);
|
||||
const parsed = new URL(fullPath);
|
||||
const parsed = new URL(fullPath, 'http://localhost');
|
||||
const protocol = parsed.protocol || supportedProtocols[0];
|
||||
|
||||
if (protocol === 'data:') {
|
||||
|
||||
Reference in New Issue
Block a user