File tree 1 file changed +8
-19
lines changed
packages/browser/src/integrations
1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change 1
- import { convertIntegrationFnToClass , defineIntegration } from '@sentry/core' ;
2
- import type { Event , Integration , IntegrationClass , IntegrationFn } from '@sentry/types' ;
3
-
1
+ import { defineIntegration } from '@sentry/core' ;
4
2
import { WINDOW } from '../helpers' ;
5
3
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 ( ( ) => {
9
9
return {
10
- name : INTEGRATION_NAME ,
10
+ name : 'HttpContext' ,
11
11
preprocessEvent ( event ) {
12
12
// if none of the information we want exists, don't bother
13
13
if ( ! WINDOW . navigator && ! WINDOW . location && ! WINDOW . document ) {
@@ -29,15 +29,4 @@ const _httpContextIntegration = (() => {
29
29
event . request = request ;
30
30
} ,
31
31
} ;
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments