Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trace): append http method to tags error when using the Header ob… #131

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

WHChen-Alex
Copy link
Contributor

@WHChen-Alex WHChen-Alex commented Jul 17, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

NodeJS Client Side Agent (apache/skywalking-client-js)

What happened

Relevant code: https://github.com/apache/skywalking-client-js/blob/master/src/trace/interceptors/fetch.ts#L116-L121

image

If we call fetch with a Request object which contains headers, these headers will be throw error if enable skywalking-client-js.

const req = new Request("/api/projects", {
  headers: {
    "my-custom-header": "test",
  },
});

fetch(req);

What you expected to happen

Fix error

How to reproduce

https://codesandbox.io/p/devbox/wh2zsm?file=%2Fpackage.json&migrateFrom=sjygtk

Open the devtools, switch to network tab, filter Fetch/XHR, open details for the request /api/projects, in Request Headers, and switch to console tab , see that error below
image

image

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am to submit a pull request on my own!

Code of Conduct

@WHChen-Alex WHChen-Alex marked this pull request as draft July 17, 2024 02:28
@WHChen-Alex WHChen-Alex marked this pull request as ready for review July 17, 2024 02:31
@WHChen-Alex WHChen-Alex marked this pull request as draft July 17, 2024 02:32
@WHChen-Alex WHChen-Alex marked this pull request as ready for review July 17, 2024 02:32
@WHChen-Alex WHChen-Alex force-pushed the alex/bugfix_request branch 2 times, most recently from aabd89d to 6e4b306 Compare July 17, 2024 02:35
@wu-sheng wu-sheng merged commit a86bb56 into apache:master Jul 17, 2024
5 checks passed
@wu-sheng wu-sheng added this to the 1.0.0 milestone Jul 17, 2024
@wu-sheng wu-sheng added the bug Something isn't working label Jul 17, 2024
@WHChen-Alex
Copy link
Contributor Author

Can you release v0.13.0 for now or last few days, please?
thx~

@Fine0830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants