2
0
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:
Dmitriy Mozgovoy
2023-02-03 19:02:50 +02:00
committed by GitHub
parent 54d3facb3b
commit 128d56f4a0
+1 -1
View File
@@ -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:') {