Skip to content

Commit 9d14753

Browse files
committed
stop adding request data event processor in express request handler
1 parent bc1004e commit 9d14753

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

packages/node/src/handlers.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { captureException, getCurrentHub, startTransaction, withScope } from '@sentry/core';
3-
import { Event, Span } from '@sentry/types';
3+
import { Span } from '@sentry/types';
44
import {
55
AddRequestDataToEventOptions,
66
addRequestDataToTransaction,
@@ -15,10 +15,9 @@ import * as domain from 'domain';
1515
import * as http from 'http';
1616

1717
import { NodeClient } from './client';
18-
import { addRequestDataToEvent, extractRequestData } from './requestdata';
19-
// TODO (v8 / XXX) Remove these imports
18+
import { extractRequestData } from './requestdata';
19+
// TODO (v8 / XXX) Remove this import
2020
import type { ParseRequestOptions } from './requestDataDeprecated';
21-
import { parseRequest } from './requestDataDeprecated';
2221
import { flush, isAutoSessionTrackingEnabled } from './sdk';
2322

2423
/**
@@ -164,15 +163,6 @@ export function requestHandler(
164163
res: http.ServerResponse,
165164
next: (error?: any) => void,
166165
): void {
167-
// TODO (v8 / XXX) Remove this shim and just use `addRequestDataToEvent`
168-
let backwardsCompatibleEventProcessor: (event: Event) => Event;
169-
if (options && 'include' in options) {
170-
backwardsCompatibleEventProcessor = (event: Event) => addRequestDataToEvent(event, req, options);
171-
} else {
172-
// eslint-disable-next-line deprecation/deprecation
173-
backwardsCompatibleEventProcessor = (event: Event) => parseRequest(event, req, options as ParseRequestOptions);
174-
}
175-
176166
if (options && options.flushTimeout && options.flushTimeout > 0) {
177167
// eslint-disable-next-line @typescript-eslint/unbound-method
178168
const _end = res.end;
@@ -195,7 +185,6 @@ export function requestHandler(
195185
const currentHub = getCurrentHub();
196186

197187
currentHub.configureScope(scope => {
198-
scope.addEventProcessor(backwardsCompatibleEventProcessor);
199188
scope.setSDKProcessingMetadata({
200189
request: req,
201190
// TODO (v8): Stop passing this

0 commit comments

Comments
 (0)