question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

7.17.1 attaching baggage header to third-party requests breaking CORS policies

See original GitHub issue

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/react

SDK Version

7.17.1

Framework Version

React 16.x

Link to Sentry event

No response

Steps to Reproduce

Our app was running fine using sentry/tracing 7.16.0 We deployed new code with sentry/tracing 7.17.1 A bunch of third party requests started failing with CORS errors: blocked by CORS policy: Request header field baggage is not allowed by Access-Control-Allow-Headers in preflight response. We roll back to previous version, errors go away

in our test environment, with Sentry enabled and sentry/tracing at 7.17.1, CORS errors on third party requests to services on other domains that we don’t control with Sentry disabled, everything is fine with Sentry/tracing on 7.16.0 and enabled, everything is fine

Expected Result

No CORS errors on third-party requests, no baggage header attached to third party requests

Actual Result

request has been blocked by CORS policy: Request header field baggage is not allowed by Access-Control-Allow-Headers in preflight response.

I have to assume this was caused by https://github.com/getsentry/sentry-javascript/pull/6039 We use default tracing config

        new TracingIntegrations.BrowserTracing(),

Which according to the docs: https://docs.sentry.io/platforms/javascript/performance/instrumentation/automatic-instrumentation/#tracingorigins should only impact calls to localhost and the same domain/origin as the page, but this does not seem to be happening

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

6reactions
Lms24commented, Oct 28, 2022

Hi @redbugz,

we just released version 7.17.2 with a fix for this bug.

2reactions
Archi4400commented, Nov 28, 2022

@Lms24 everything is ok, it works. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect Services for JavaScript - Sentry Documentation
The sentry-trace header holds information for identifying the trace, while the W3C compliant baggage header contains additional trace-related data that is used ...
Read more >
How to Avoid CORS Security Issues in 2021 | Cross-Origin ...
The CORS specification defines a set of headers that allow the server and browser to determine which requests for cross-domain resources ( ...
Read more >
sentry Changelog - PyUp.io
Parse incoming [W3C Baggage Headers](https://www.w3.org/TR/baggage/) and ... Sentry now maintains full support for CORS requests from external hosts.
Read more >
Propagation format for distributed context: Baggage - W3C
The baggage header is used to propagate user-supplied key-value pairs through a distributed request. A received header MAY be altered to change ...
Read more >
ARMY DRAFT UFP-QAPP RCRA FACILITY INVESTIGATION
Uniform Federal Policy for Quality Assurance Project Plans. U.S.. United States. USACE. United States Army Corps of Engineers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found