Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@datadog/browser-core

Package Overview
Dependencies
Maintainers
1
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-core - npm Package Compare versions

Comparing version 4.16.0 to 4.16.1

2

cjs/boot/init.js

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

var publicApi = (0, utils_1.assign)({
version: "4.16.0",
version: "4.16.1",
// 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

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

method: method,
url: (0, urlPolyfill_1.normalizeUrl)(url.toString()),
url: (0, urlPolyfill_1.normalizeUrl)(String(url)),
});

@@ -47,0 +47,0 @@ }

@@ -28,5 +28,5 @@ "use strict";

var parameters = 'ddsource=browser' +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.16.0")].concat(tags).join(','))) +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.16.1")].concat(tags).join(','))) +
"&dd-api-key=".concat(clientToken) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.16.0")) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.16.1")) +
'&dd-evp-origin=browser' +

@@ -33,0 +33,0 @@ "&dd-request-id=".concat((0, utils_1.generateUUID)());

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

service: 'browser-sdk',
version: "4.16.0",
version: "4.16.1",
source: 'browser',

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

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

var publicApi = assign({
version: "4.16.0",
version: "4.16.1",
// 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

@@ -40,3 +40,3 @@ import { instrumentMethodAndCallOriginal } from '../tools/instrumentMethod';

method: method,
url: normalizeUrl(url.toString()),
url: normalizeUrl(String(url)),
});

@@ -43,0 +43,0 @@ }

@@ -25,5 +25,5 @@ import { timeStampNow } from '../../tools/timeUtils';

var parameters = 'ddsource=browser' +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.16.0")].concat(tags).join(','))) +
"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.16.1")].concat(tags).join(','))) +
"&dd-api-key=".concat(clientToken) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.16.0")) +
"&dd-evp-origin-version=".concat(encodeURIComponent("4.16.1")) +
'&dd-evp-origin=browser' +

@@ -30,0 +30,0 @@ "&dd-request-id=".concat(generateUUID());

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

service: 'browser-sdk',
version: "4.16.0",
version: "4.16.1",
source: 'browser',

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

{
"name": "@datadog/browser-core",
"version": "4.16.0",
"version": "4.16.1",
"license": "Apache-2.0",

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

},
"gitHead": "127958d05da4b7b91f08a4f8b9c609ac2753f31b"
"gitHead": "944a34d52f4b378b01e75b3a95d1a31c8c14e1aa"
}
import { stubXhr, withXhr } from '../../test/specHelper'
import { isIE } from '../tools/browserDetection'
import type { Subscription } from '../tools/observable'

@@ -6,3 +7,3 @@ import type { XhrCompleteContext, XhrContext } from './xhrObservable'

describe('xhr proxy', () => {
describe('xhr observable', () => {
let requestsTrackingSubscription: Subscription

@@ -295,2 +296,55 @@ let contextEditionSubscription: Subscription | undefined

it('should track request to undefined url', (done) => {
withXhr({
setup(xhr) {
xhr.open('GET', undefined)
xhr.send()
xhr.complete(404, 'NOT FOUND')
},
onComplete() {
const request = requests[0]
expect(request.method).toBe('GET')
expect(request.url).toContain('/undefined')
expect(request.status).toBe(404)
done()
},
})
})
it('should track request to null url', (done) => {
withXhr({
setup(xhr) {
xhr.open('GET', null)
xhr.send()
xhr.complete(404, 'NOT FOUND')
},
onComplete() {
const request = requests[0]
expect(request.method).toBe('GET')
expect(request.url).toContain('/null')
expect(request.status).toBe(404)
done()
},
})
})
it('should track request to URL object', (done) => {
if (isIE()) {
pending('IE not supported')
}
withXhr({
setup(xhr) {
xhr.open('GET', new URL('http://example.com/path'))
xhr.send()
xhr.complete(200, 'ok')
},
onComplete() {
const request = requests[0]
expect(request.method).toBe('GET')
expect(request.url).toBe('http://example.com/path')
done()
},
})
})
describe('when unsubscribing', () => {

@@ -297,0 +351,0 @@ it('should stop tracking requests', (done) => {

@@ -66,7 +66,7 @@ import { instrumentMethodAndCallOriginal } from '../tools/instrumentMethod'

function openXhr(this: XMLHttpRequest, method: string, url: string | URL) {
function openXhr(this: XMLHttpRequest, method: string, url: string | URL | undefined | null) {
xhrContexts.set(this, {
state: 'open',
method,
url: normalizeUrl(url.toString()),
url: normalizeUrl(String(url)),
})

@@ -73,0 +73,0 @@ }

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc