All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.esm.utils.isSentryRequestUrl.js.map Maven / Gradle / Ivy

There is a newer version: 8.39.0
Show newest version
{"version":3,"file":"isSentryRequestUrl.js","sources":["../../../src/utils/isSentryRequestUrl.ts"],"sourcesContent":["import type { Client, DsnComponents } from '@sentry/types';\n\n/**\n * Checks whether given url points to Sentry server\n *\n * @param url url to verify\n */\nexport function isSentryRequestUrl(url: string, client: Client | undefined): boolean {\n  const dsn = client && client.getDsn();\n  const tunnel = client && client.getOptions().tunnel;\n  return checkDsn(url, dsn) || checkTunnel(url, tunnel);\n}\n\nfunction checkTunnel(url: string, tunnel: string | undefined): boolean {\n  if (!tunnel) {\n    return false;\n  }\n\n  return removeTrailingSlash(url) === removeTrailingSlash(tunnel);\n}\n\nfunction checkDsn(url: string, dsn: DsnComponents | undefined): boolean {\n  return dsn ? url.includes(dsn.host) : false;\n}\n\nfunction removeTrailingSlash(str: string): string {\n  return str[str.length - 1] === '/' ? str.slice(0, -1) : str;\n}\n"],"names":[],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,GAAG,EAAU,MAAM,EAA+B;AACrF,EAAE,MAAM,MAAM,MAAA,IAAU,MAAM,CAAC,MAAM,EAAE,CAAA;AACvC,EAAE,MAAM,MAAO,GAAE,MAAO,IAAG,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM,CAAA;AACrD,EAAE,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAE,IAAG,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AACvD,CAAA;AACA;AACA,SAAS,WAAW,CAAC,GAAG,EAAU,MAAM,EAA+B;AACvE,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,KAAK,CAAA;AAChB,GAAE;AACF;AACA,EAAE,OAAO,mBAAmB,CAAC,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAA;AACjE,CAAA;AACA;AACA,SAAS,QAAQ,CAAC,GAAG,EAAU,GAAG,EAAsC;AACxE,EAAE,OAAO,GAAA,GAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAE,GAAE,KAAK,CAAA;AAC7C,CAAA;AACA;AACA,SAAS,mBAAmB,CAAC,GAAG,EAAkB;AAClD,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,MAAO,GAAE,CAAC,CAAA,KAAM,GAAA,GAAM,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,GAAE,GAAG,CAAA;AAC7D;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy