Skip to content

Commit 44ff5ee

Browse files
committed
fix test
1 parent 7becd6c commit 44ff5ee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/cloudflare/test/integrations/fetch.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ describe('WinterCGFetch instrumentation', () => {
101101
expect(fetchInstrumentationHandlerCallback).toBeDefined();
102102

103103
const startHandlerData: HandlerDataFetch = {
104-
fetchData: { url: 'https://dsn.ingest.sentry.io/1337', method: 'POST' },
105-
args: ['https://dsn.ingest.sentry.io/1337'],
104+
fetchData: { url: 'https://dsn.ingest.sentry.io/1337?sentry_key=123', method: 'POST' },
105+
args: ['https://dsn.ingest.sentry.io/1337?sentry_key=123'],
106106
startTimestamp: Date.now(),
107107
};
108108
fetchInstrumentationHandlerCallback(startHandlerData);

packages/core/src/utils/isSentryRequestUrl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ function checkDsn(url: string, dsn: DsnComponents | undefined): boolean {
2424
// Requests to Sentry's ingest endpoint must have a `sentry_key` in the query string
2525
// This is equivalent to the public_key which is required in the DSN
2626
// see https://develop.sentry.dev/sdk/overview/#parsing-the-dsn
27+
// Therefore a request to the same host and with a `sentry_key` in the query string
28+
// can be considered a request to the ingest endpoint
2729
return dsn ? url.includes(dsn.host) && !!url.match(/sentry_key/) : false;
2830
}
2931

0 commit comments

Comments
 (0)