Files
klz-cables.com/.pnpm-store/v10/files/cf/ecfb155ca10b807126f8d08b6fdb93a69715b0df0a8c0773b76816554ad79bb0be4a104d59ec6b2f2e387bd23ff36440f1c255d669bed31aaa6529c2767bfc
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

44 lines
1.3 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const url = require('./url.js');
/**
* Checks whether given url points to Sentry server
*
* @param url url to verify
*/
function isSentryRequestUrl(url, client) {
const dsn = client?.getDsn();
const tunnel = client?.getOptions().tunnel;
return checkDsn(url, dsn) || checkTunnel(url, tunnel);
}
function checkTunnel(url, tunnel) {
if (!tunnel) {
return false;
}
return removeTrailingSlash(url) === removeTrailingSlash(tunnel);
}
function checkDsn(url$1, dsn) {
// Requests to Sentry's ingest endpoint must have a `sentry_key` in the query string
// This is equivalent to the public_key which is required in the DSN
// see https://develop.sentry.dev/sdk/overview/#parsing-the-dsn
// Therefore, a request to the same host and with a `sentry_key` in the query string
// can be considered a request to the ingest endpoint.
const urlParts = url.parseStringToURLObject(url$1);
if (!urlParts || url.isURLObjectRelative(urlParts)) {
return false;
}
return dsn ? urlParts.host.includes(dsn.host) && /(^|&|\?)sentry_key=/.test(urlParts.search) : false;
}
function removeTrailingSlash(str) {
return str[str.length - 1] === '/' ? str.slice(0, -1) : str;
}
exports.isSentryRequestUrl = isSentryRequestUrl;
//# sourceMappingURL=isSentryRequestUrl.js.map