Skip to content

Commit e0882f1

Browse files
authored
feat(browser): Remove HttpContext integration class (#10987)
Removes the old class-based `HttpContext` integration in favor of the `httpContextIntegration`.
1 parent cd5d63a commit e0882f1

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed
Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';
2-
import type { Event, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';
3-
1+
import { defineIntegration } from '@sentry/core';
42
import { WINDOW } from '../helpers';
53

6-
const INTEGRATION_NAME = 'HttpContext';
7-
8-
const _httpContextIntegration = (() => {
4+
/**
5+
* Collects information about HTTP request headers and
6+
* attaches them to the event.
7+
*/
8+
export const httpContextIntegration = defineIntegration(() => {
99
return {
10-
name: INTEGRATION_NAME,
10+
name: 'HttpContext',
1111
preprocessEvent(event) {
1212
// if none of the information we want exists, don't bother
1313
if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {
@@ -29,15 +29,4 @@ const _httpContextIntegration = (() => {
2929
event.request = request;
3030
},
3131
};
32-
}) satisfies IntegrationFn;
33-
34-
export const httpContextIntegration = defineIntegration(_httpContextIntegration);
35-
36-
/**
37-
* HttpContext integration collects information about HTTP request headers.
38-
* @deprecated Use `httpContextIntegration()` instead.
39-
*/
40-
// eslint-disable-next-line deprecation/deprecation
41-
export const HttpContext = convertIntegrationFnToClass(INTEGRATION_NAME, httpContextIntegration) as IntegrationClass<
42-
Integration & { preprocessEvent: (event: Event) => void }
43-
>;
32+
});

0 commit comments

Comments
 (0)