Socket
Socket
Sign inDemoInstall

@datadog/browser-core

Package Overview
Dependencies
0
Maintainers
1
Versions
248
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.32.1 to 4.33.0

2

cjs/boot/init.js

@@ -9,3 +9,3 @@ "use strict";

var publicApi = (0, utils_1.assign)({
version: "4.32.1",
version: "4.33.0",
// This API method is intentionally not monitored, since the only thing executed is the

@@ -12,0 +12,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and

@@ -25,3 +25,3 @@ "use strict";

build: function (api, retry) {
var tags = ["sdk_version:".concat("4.32.1"), "api:".concat(api)].concat(configurationTags);
var tags = ["sdk_version:".concat("4.33.0"), "api:".concat(api)].concat(configurationTags);
if (retry) {

@@ -34,3 +34,3 @@ tags.push("retry_count:".concat(retry.count), "retry_after:".concat(retry.lastFailureStatus));

"dd-api-key=".concat(clientToken),
"dd-evp-origin-version=".concat(encodeURIComponent("4.32.1")),
"dd-evp-origin-version=".concat(encodeURIComponent("4.33.0")),
'dd-evp-origin=browser',

@@ -62,4 +62,5 @@ "dd-request-id=".concat((0, utils_1.generateUUID)()),

var extension = domainParts.pop();
return "".concat(exports.ENDPOINTS[endpointType], ".browser-intake-").concat(domainParts.join('-'), ".").concat(extension);
var subdomain = site !== intakeSites_1.INTAKE_SITE_AP1 ? "".concat(exports.ENDPOINTS[endpointType], ".") : '';
return "".concat(subdomain, "browser-intake-").concat(domainParts.join('-'), ".").concat(extension);
}
//# sourceMappingURL=endpointBuilder.js.map
export declare const INTAKE_SITE_STAGING = "datad0g.com";
export declare const INTAKE_SITE_US1 = "datadoghq.com";
export declare const INTAKE_SITE_AP1 = "ap1.datadoghq.com";
export declare const INTAKE_SITE_US1_FED = "ddog-gov.com";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.INTAKE_SITE_US1_FED = exports.INTAKE_SITE_US1 = exports.INTAKE_SITE_STAGING = void 0;
exports.INTAKE_SITE_US1_FED = exports.INTAKE_SITE_AP1 = exports.INTAKE_SITE_US1 = exports.INTAKE_SITE_STAGING = void 0;
exports.INTAKE_SITE_STAGING = 'datad0g.com';
exports.INTAKE_SITE_US1 = 'datadoghq.com';
exports.INTAKE_SITE_AP1 = 'ap1.datadoghq.com';
exports.INTAKE_SITE_US1_FED = 'ddog-gov.com';
//# sourceMappingURL=intakeSites.js.map

@@ -47,3 +47,3 @@ "use strict";

service: telemetryService,
version: "4.32.1",
version: "4.33.0",
source: 'browser',

@@ -50,0 +50,0 @@ _dd: {

@@ -6,3 +6,3 @@ import { catchUserErrors } from '../tools/catchUserErrors';

var publicApi = assign({
version: "4.32.1",
version: "4.33.0",
// This API method is intentionally not monitored, since the only thing executed is the

@@ -9,0 +9,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and

import { timeStampNow } from '../../tools/timeUtils';
import { normalizeUrl } from '../../tools/urlPolyfill';
import { generateUUID } from '../../tools/utils';
import { INTAKE_SITE_US1 } from './intakeSites';
import { INTAKE_SITE_AP1, INTAKE_SITE_US1 } from './intakeSites';
export var ENDPOINTS = {

@@ -22,3 +22,3 @@ logs: 'logs',

build: function (api, retry) {
var tags = ["sdk_version:".concat("4.32.1"), "api:".concat(api)].concat(configurationTags);
var tags = ["sdk_version:".concat("4.33.0"), "api:".concat(api)].concat(configurationTags);
if (retry) {

@@ -31,3 +31,3 @@ tags.push("retry_count:".concat(retry.count), "retry_after:".concat(retry.lastFailureStatus));

"dd-api-key=".concat(clientToken),
"dd-evp-origin-version=".concat(encodeURIComponent("4.32.1")),
"dd-evp-origin-version=".concat(encodeURIComponent("4.33.0")),
'dd-evp-origin=browser',

@@ -58,4 +58,5 @@ "dd-request-id=".concat(generateUUID()),

var extension = domainParts.pop();
return "".concat(ENDPOINTS[endpointType], ".browser-intake-").concat(domainParts.join('-'), ".").concat(extension);
var subdomain = site !== INTAKE_SITE_AP1 ? "".concat(ENDPOINTS[endpointType], ".") : '';
return "".concat(subdomain, "browser-intake-").concat(domainParts.join('-'), ".").concat(extension);
}
//# sourceMappingURL=endpointBuilder.js.map
export declare const INTAKE_SITE_STAGING = "datad0g.com";
export declare const INTAKE_SITE_US1 = "datadoghq.com";
export declare const INTAKE_SITE_AP1 = "ap1.datadoghq.com";
export declare const INTAKE_SITE_US1_FED = "ddog-gov.com";
export var INTAKE_SITE_STAGING = 'datad0g.com';
export var INTAKE_SITE_US1 = 'datadoghq.com';
export var INTAKE_SITE_AP1 = 'ap1.datadoghq.com';
export var INTAKE_SITE_US1_FED = 'ddog-gov.com';
//# sourceMappingURL=intakeSites.js.map

@@ -44,3 +44,3 @@ import { ConsoleApiName } from '../../tools/display';

service: telemetryService,
version: "4.32.1",
version: "4.33.0",
source: 'browser',

@@ -47,0 +47,0 @@ _dd: {

{
"name": "@datadog/browser-core",
"version": "4.32.1",
"version": "4.33.0",
"license": "Apache-2.0",

@@ -24,3 +24,3 @@ "main": "cjs/index.js",

},
"gitHead": "c9e05c379595bfe664fbc673f2d429b3dee5274a"
"gitHead": "09cba227ece772311f6a00f96fd27705acf5c118"
}

@@ -6,3 +6,3 @@ import type { RetryInfo } from '../../transport'

import type { InitConfiguration } from './configuration'
import { INTAKE_SITE_US1 } from './intakeSites'
import { INTAKE_SITE_AP1, INTAKE_SITE_US1 } from './intakeSites'

@@ -80,3 +80,4 @@ // replaced at build time

const extension = domainParts.pop()
return `${ENDPOINTS[endpointType]}.browser-intake-${domainParts.join('-')}.${extension!}`
const subdomain = site !== INTAKE_SITE_AP1 ? `${ENDPOINTS[endpointType]}.` : ''
return `${subdomain}browser-intake-${domainParts.join('-')}.${extension!}`
}
export const INTAKE_SITE_STAGING = 'datad0g.com'
export const INTAKE_SITE_US1 = 'datadoghq.com'
export const INTAKE_SITE_AP1 = 'ap1.datadoghq.com'
export const INTAKE_SITE_US1_FED = 'ddog-gov.com'

@@ -66,13 +66,21 @@ import { computeTransportConfiguration } from './transportConfiguration'

;[
{ site: 'datadoghq.eu', intakeDomain: 'browser-intake-datadoghq.eu' },
{ site: 'datadoghq.com', intakeDomain: 'browser-intake-datadoghq.com' },
{ site: 'us3.datadoghq.com', intakeDomain: 'browser-intake-us3-datadoghq.com' },
{ site: 'us5.datadoghq.com', intakeDomain: 'browser-intake-us5-datadoghq.com' },
{ site: 'ddog-gov.com', intakeDomain: 'browser-intake-ddog-gov.com' },
].forEach(({ site, intakeDomain }) => {
{ expectSubdomain: true, site: 'datadoghq.eu', intakeDomain: 'browser-intake-datadoghq.eu' },
{ expectSubdomain: true, site: 'datadoghq.com', intakeDomain: 'browser-intake-datadoghq.com' },
{ expectSubdomain: true, site: 'us3.datadoghq.com', intakeDomain: 'browser-intake-us3-datadoghq.com' },
{ expectSubdomain: true, site: 'us5.datadoghq.com', intakeDomain: 'browser-intake-us5-datadoghq.com' },
{ expectSubdomain: true, site: 'ddog-gov.com', intakeDomain: 'browser-intake-ddog-gov.com' },
{ expectSubdomain: false, site: 'ap1.datadoghq.com', intakeDomain: 'browser-intake-ap1-datadoghq.com' },
].forEach(({ site, intakeDomain, expectSubdomain }) => {
it(`should detect intake request for ${site} site`, () => {
const configuration = computeTransportConfiguration({ clientToken, site })
expect(configuration.isIntakeUrl(`https://rum.${intakeDomain}/api/v2/rum?xxx`)).toBe(true)
expect(configuration.isIntakeUrl(`https://logs.${intakeDomain}/api/v2/logs?xxx`)).toBe(true)
expect(configuration.isIntakeUrl(`https://session-replay.${intakeDomain}/api/v2/replay?xxx`)).toBe(true)
expect(configuration.isIntakeUrl(`https://rum.${intakeDomain}/api/v2/rum?xxx`)).toBe(expectSubdomain)
expect(configuration.isIntakeUrl(`https://logs.${intakeDomain}/api/v2/logs?xxx`)).toBe(expectSubdomain)
expect(configuration.isIntakeUrl(`https://session-replay.${intakeDomain}/api/v2/replay?xxx`)).toBe(
expectSubdomain
)
expect(configuration.isIntakeUrl(`https://${intakeDomain}/api/v2/rum?xxx`)).toBe(!expectSubdomain)
expect(configuration.isIntakeUrl(`https://${intakeDomain}/api/v2/logs?xxx`)).toBe(!expectSubdomain)
expect(configuration.isIntakeUrl(`https://${intakeDomain}/api/v2/replay?xxx`)).toBe(!expectSubdomain)
})

@@ -94,11 +102,2 @@ })

it('should handle sites with subdomains', () => {
const configuration = computeTransportConfiguration({ clientToken, site: 'foo.datadoghq.com' })
expect(configuration.isIntakeUrl('https://rum.browser-intake-foo-datadoghq.com/api/v2/rum?xxx')).toBe(true)
expect(configuration.isIntakeUrl('https://logs.browser-intake-foo-datadoghq.com/api/v2/logs?xxx')).toBe(true)
expect(
configuration.isIntakeUrl('https://session-replay.browser-intake-foo-datadoghq.com/api/v2/replay?xxx')
).toBe(true)
})
it('should detect proxy intake request', () => {

@@ -117,6 +116,7 @@ let configuration = computeTransportConfiguration({ clientToken, proxyUrl: 'https://www.proxy.com' })

;[
{ site: 'datadoghq.eu', intakeDomain: 'browser-intake-datadoghq.eu' },
{ site: 'us3.datadoghq.com', intakeDomain: 'browser-intake-us3-datadoghq.com' },
{ site: 'us5.datadoghq.com', intakeDomain: 'browser-intake-us5-datadoghq.com' },
].forEach(({ site, intakeDomain }) => {
{ site: 'datadoghq.eu' },
{ site: 'us3.datadoghq.com' },
{ site: 'us5.datadoghq.com' },
{ site: 'ap1.datadoghq.com' },
].forEach(({ site }) => {
it(`should detect replica intake request for site ${site}`, () => {

@@ -130,6 +130,2 @@ const configuration = computeTransportConfiguration({

expect(configuration.isIntakeUrl(`https://rum.${intakeDomain}/api/v2/rum?xxx`)).toBe(true)
expect(configuration.isIntakeUrl(`https://logs.${intakeDomain}/api/v2/logs?xxx`)).toBe(true)
expect(configuration.isIntakeUrl(`https://session-replay.${intakeDomain}/api/v2/replay?xxx`)).toBe(true)
expect(configuration.isIntakeUrl(`https://${internalAnalyticsSubdomain}.datadoghq.com/api/v2/rum?xxx`)).toBe(

@@ -136,0 +132,0 @@ true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc