From 128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c Mon Sep 17 00:00:00 2001 From: Dmitriy Mozgovoy Date: Fri, 3 Feb 2023 19:02:50 +0200 Subject: [PATCH] fix(http): treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; (#5528) --- lib/adapters/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/adapters/http.js b/lib/adapters/http.js index d03db3a622..760efc3d0e 100755 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -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:') {