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(instrumentation-fetch): compatibility with Map inputs for request headers with fetch #4348

Merged
merged 9 commits into from
Jan 25, 2024

Conversation

rdeavila94
Copy link
Contributor

@rdeavila94 rdeavila94 commented Dec 6, 2023

…uts for request headers with fetch

Which problem is this PR solving?

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

#4347 (comment)

Short description of the changes

_addHeaders is not handling a type of Map, so it is resorting to extracting the keys as if the headers are an object literal, which it isn't.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit test verifying functionality
  • Usage on an actual browser to verify that the header is sent.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@rdeavila94 rdeavila94 requested a review from a team December 6, 2023 07:13
Copy link

linux-foundation-easycla bot commented Dec 6, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@pichlermarc pichlermarc changed the title fix(@opentelemetry-instrumentation-fetch): compatibility with Map inp… fix(instrumentation-fetch): compatibility with Map inputs for request headers with fetch Dec 6, 2023
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Hi @rdeavila94, thank you for your contribution.

Unfortunately we cannot merge the PR unless the Contributor License Agreement is signed (see here #4348 (comment)) - please ensure that it is signed so that we can proceed with the review process, thanks! 🙂

experimental/CHANGELOG.md Outdated Show resolved Hide resolved
rdeavila94 and others added 2 commits December 15, 2023 13:55
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Merging #4348 (b6b6c9d) into main (5afbcdb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4348   +/-   ##
=======================================
  Coverage   92.22%   92.23%           
=======================================
  Files         336      336           
  Lines        9522     9525    +3     
  Branches     2018     2020    +2     
=======================================
+ Hits         8782     8785    +3     
  Misses        740      740           
Files Coverage Δ
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 96.59% <100.00%> (+0.05%) ⬆️

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

LGTM

@rdeavila94 rdeavila94 force-pushed the map-input-fix branch 2 times, most recently from d300b82 to 6ebca8e Compare January 3, 2024 18:38
@pichlermarc pichlermarc merged commit 3711990 into open-telemetry:main Jan 25, 2024
20 checks passed
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
… headers with fetch (open-telemetry#4348)

* fix(@opentelemetry-instrumentation-fetch): compatibility with Map inputs for request headers with fetch

* Update experimental/CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* adding description for ts-ignore

* fix(changlog): move entry to unreleased

* fix: add lint ignore

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto-instrumentation-fetch replaces headers when req.headers input is of type Map
3 participants