Skip to content

Commit

Permalink
ref: Remove unused sentry_timestamp header (#2458)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek authored Feb 27, 2020
1 parent 758722e commit 2e11882
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DsnLike } from '@sentry/types';
import { Dsn, timestampWithMs, urlEncode } from '@sentry/utils';
import { Dsn, urlEncode } from '@sentry/utils';

const SENTRY_API_VERSION = '7';

Expand Down Expand Up @@ -52,7 +52,6 @@ export class API {
public getRequestHeaders(clientName: string, clientVersion: string): { [key: string]: string } {
const dsn = this._dsnObject;
const header = [`Sentry sentry_version=${SENTRY_API_VERSION}`];
header.push(`sentry_timestamp=${timestampWithMs()}`); // TODO: This can be removed
header.push(`sentry_client=${clientName}/${clientVersion}`);
header.push(`sentry_key=${dsn.user}`);
if (dsn.pass) {
Expand Down
6 changes: 2 additions & 4 deletions packages/core/test/lib/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ describe('API', () => {
test('getRequestHeaders', () => {
expect(new API(dsnPublic).getRequestHeaders('a', '1.0')).toMatchObject({
'Content-Type': 'application/json',
'X-Sentry-Auth': expect.stringMatching(
/^Sentry sentry_version=\d, sentry_timestamp=\d+\.\d+, sentry_client=a\/1\.0, sentry_key=abc$/,
),
'X-Sentry-Auth': expect.stringMatching(/^Sentry sentry_version=\d, sentry_client=a\/1\.0, sentry_key=abc$/),
});

expect(new API(legacyDsn).getRequestHeaders('a', '1.0')).toMatchObject({
'Content-Type': 'application/json',
'X-Sentry-Auth': expect.stringMatching(
/^Sentry sentry_version=\d, sentry_timestamp=\d+\.\d+, sentry_client=a\/1\.0, sentry_key=abc, sentry_secret=123$/,
/^Sentry sentry_version=\d, sentry_client=a\/1\.0, sentry_key=abc, sentry_secret=123$/,
),
});
});
Expand Down
1 change: 0 additions & 1 deletion packages/node/test/transports/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function createTransport(options: TransportOptions): HTTPTransport {

function assertBasicOptions(options: any): void {
expect(options.headers['X-Sentry-Auth']).toContain('sentry_version');
expect(options.headers['X-Sentry-Auth']).toContain('sentry_timestamp');
expect(options.headers['X-Sentry-Auth']).toContain('sentry_client');
expect(options.headers['X-Sentry-Auth']).toContain('sentry_key');
expect(options.port).toEqual('8989');
Expand Down
1 change: 0 additions & 1 deletion packages/node/test/transports/https.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function createTransport(options: TransportOptions): HTTPSTransport {

function assertBasicOptions(options: any): void {
expect(options.headers['X-Sentry-Auth']).toContain('sentry_version');
expect(options.headers['X-Sentry-Auth']).toContain('sentry_timestamp');
expect(options.headers['X-Sentry-Auth']).toContain('sentry_client');
expect(options.headers['X-Sentry-Auth']).toContain('sentry_key');
expect(options.port).toEqual('8989');
Expand Down

0 comments on commit 2e11882

Please sign in to comment.