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 sw8 to header when using the Header object in queries #127

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

Fine0830
Copy link
Member

Fixes apache/skywalking#12367

Screenshot

1

Signed-off-by: Qiuxia Fan [email protected]

@Fine0830 Fine0830 added the bug Something isn't working label Jun 25, 2024
@Fine0830 Fine0830 added this to the 1.0.0 milestone Jun 25, 2024
@Fine0830 Fine0830 requested a review from wu-sheng June 25, 2024 02:51
@Fine0830 Fine0830 self-assigned this Jun 25, 2024
@wu-sheng wu-sheng merged commit 6ccbcd2 into apache:master Jun 25, 2024
5 checks passed
@Fine0830 Fine0830 deleted the bugfix/fetch branch June 25, 2024 03:23
@@ -83,9 +83,13 @@ export default function windowFetch(options: CustomOptionsType, segments: Segmen
args[1] = {};
}
if (!args[1].headers) {
args[1].headers = {};
args[1].headers = new Headers();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:

// Copy headers from the first arg if it is a Request object
args[1].headers = Object.prototype.toString.call(args[0]) === '[object Request]'
  ? new Headers(args[0].headers)
  : new Headers();

@Fine0830 Fine0830 modified the milestones: 1.0.0, 0.12.0 Jul 11, 2024
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.

[Bug] Skywalking-client-js breaks native fetch implementation when using Request object with headers
3 participants