This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-nodejs.git
The following commit(s) were added to refs/heads/master by this push:
new 7232663 Fix invalid url error in axios plugin (#93)
7232663 is described below
commit 72326635040f1e993f51ba73c685098a1d686477
Author: kezhenxu94 <[email protected]>
AuthorDate: Tue Sep 20 19:59:47 2022 +0800
Fix invalid url error in axios plugin (#93)
---
src/plugins/AxiosPlugin.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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()