Skip to content

Commit 2bb98c1

Browse files
authored
test: Replace Authorization with Accept header (#3400)
The actual header doesn't matter for the test, so using something that doesn't look like a leaked credential.
1 parent 8b4a7f2 commit 2bb98c1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/browser/test/unit/transports/fetch.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('FetchTransport', () => {
8787
{
8888
dsn: testDsn,
8989
headers: {
90-
Authorization: 'Basic GVzdDp0ZXN0Cg==',
90+
Accept: 'application/json',
9191
},
9292
},
9393
window.fetch,
@@ -103,7 +103,7 @@ describe('FetchTransport', () => {
103103
fetch.calledWith(storeUrl, {
104104
body: JSON.stringify(eventPayload),
105105
headers: {
106-
Authorization: 'Basic GVzdDp0ZXN0Cg==',
106+
Accept: 'application/json',
107107
},
108108
method: 'POST',
109109
referrerPolicy: 'origin',

packages/browser/test/unit/transports/xhr.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('XHRTransport', () => {
6464
transport = new Transports.XHRTransport({
6565
dsn: testDsn,
6666
headers: {
67-
Authorization: 'Basic GVzdDp0ZXN0Cg==',
67+
Accept: 'application/json',
6868
},
6969
});
7070

@@ -74,8 +74,7 @@ describe('XHRTransport', () => {
7474

7575
expect(res.status).equal(Status.Success);
7676
const requestHeaders: { [key: string]: string } = request.requestHeaders as { [key: string]: string };
77-
const authHeaderLabel = 'Authorization';
78-
expect(requestHeaders[authHeaderLabel]).equal('Basic GVzdDp0ZXN0Cg==');
77+
expect(requestHeaders['Accept']).equal('application/json');
7978
});
8079

8180
describe('Rate-limiting', () => {

0 commit comments

Comments
 (0)