Skip to content

CORS issue on third-parti since v7.13.0 -  #6192

Description

@Quentin-Danjou

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/gatsby

SDK Version

7.19.0

Framework Version

4.17.2

Link to Sentry event

No response

Steps to Reproduce

Going from anything above 7.12.1 it seems the header

Access-Control-Request-Headersbaggage,sentry-trace

is being added despite having a URL not matching the tracingOrigins. We also tried to use many of the new versions as we know some fixes have been done, but it did not solve (entirely?) the issue.
We tried:
7.17.2 – Did not work
7.17.3 which was the latest when we started to investigate the issue – Did not work
7.19.0 literally 2 hours after its release

  • with the new tracePropagationTargets – Did not work
  • with shouldCreateSpanForRequest (function doing the RegEx match) - Did not work

Then we bisect to find which version exactly broke (we were initially using a 7.11.x) and found that the first version where the issue is showing is v7.13.0.

We are using a single package.json with:
@sentry/gatsby
@sentry/node (used by our lambdas)
@sentry/tracing

We use Sentry in a sentry.config.js with the following full content:

import*asSentryfrom"@sentry/gatsby";import{Integrations}from"@sentry/tracing";Sentry.init({dsn: "--The DSN url string--",sampleRate: 0.4,tracesSampleRate: 0.1,release: process.env.GATSBY_COMMIT_REF,environment: process.env.GATSBY_SENTRY_ENV,integrations: [newIntegrations.BrowserTracing({tracingOrigins: [/^http:\/\/localhost/,/^https:\/\/www.ourdomain.com/,/^https:\/\/ourdomain.com/,/^https:\/\/checkout.ourdomain.com/,/^https:\/\/store.ourdomain.com/,],}),],});

Expected Result

Header should not be attached.

Actual Result

Here is the request having a CORS issue:

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions