diff --git a/src/plugins/AxiosPlugin.ts b/src/plugins/AxiosPlugin.ts index 63b3e85..2889105 100644 --- a/src/plugins/AxiosPlugin.ts +++ b/src/plugins/AxiosPlugin.ts @@ -43,7 +43,7 @@ class AxiosPlugin implements SwPlugin { if (typeof url === 'string') config = config ? { ...config, url } : { url }; else config = url ? { ...url } : {}; - const { origin, host, pathname: operation } = new URL(config.url, config.baseURL); // TODO: this may throw invalid URL + const { origin, host, pathname: operation } = new URL(config.url, config.baseURL ?? this.defaults?.baseURL); const method = (config.method || 'GET').toUpperCase(); const span = ignoreHttpMethodCheck(method) ? DummySpan.create()