You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2024/07/17 03:31:58 UTC

(skywalking-client-js) branch master updated: fix(trace): append http method to tags error when using the Header object in queries (#131)

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-client-js.git


The following commit(s) were added to refs/heads/master by this push:
     new a86bb56  fix(trace): append http method to tags error when using the Header object in queries (#131)
a86bb56 is described below

commit a86bb56fe02eebd748119a7e374a738b0b966210
Author: Chén Wénháo <al...@easyops.cn>
AuthorDate: Wed Jul 17 11:31:54 2024 +0800

    fix(trace): append http method to tags error when using the Header object in queries (#131)
---
 src/trace/interceptors/fetch.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/trace/interceptors/fetch.ts b/src/trace/interceptors/fetch.ts
index b6746e0..9c8f8da 100644
--- a/src/trace/interceptors/fetch.ts
+++ b/src/trace/interceptors/fetch.ts
@@ -117,7 +117,7 @@ export default function windowFetch(options: CustomOptionsType, segments: Segmen
         const tags = [
           {
             key: 'http.method',
-            value: args[1].method || 'GET',
+            value: args[0] instanceof Request ? args[0].method : args[1]?.method || 'GET',
           },
           {
             key: 'url',