@@ -5,6 +5,7 @@ import { forget } from '@sentry/utils/async';
5
5
import { serialize } from '@sentry/utils/object' ;
6
6
import { parse as parseCookie } from 'cookie' ;
7
7
import * as domain from 'domain' ;
8
+ import * as http from 'http' ;
8
9
import { hostname } from 'os' ;
9
10
import { parse as parseUrl } from 'url' ;
10
11
import { NodeClient } from './client' ;
@@ -135,8 +136,8 @@ function parseRequest(
135
136
}
136
137
137
138
/** JSDoc */
138
- export function requestHandler ( ) : ( req : Request , res : Response , next : ( ) => void ) => void {
139
- return function sentryRequestMiddleware ( req : Request , _res : Response , next : ( ) => void ) : void {
139
+ export function requestHandler ( ) : ( req : http . ClientRequest , res : http . ServerResponse , next : ( ) => void ) => void {
140
+ return function sentryRequestMiddleware ( req : http . ClientRequest , _res : http . ServerResponse , next : ( ) => void ) : void {
140
141
const local = domain . create ( ) ;
141
142
const hub = getHubFromCarrier ( req ) ;
142
143
hub . bindClient ( getCurrentHub ( ) . getClient ( ) ) ;
@@ -168,14 +169,14 @@ function getStatusCodeFromResponse(error: MiddlewareError): number {
168
169
/** JSDoc */
169
170
export function errorHandler ( ) : (
170
171
error : MiddlewareError ,
171
- req : Request ,
172
- res : Response ,
172
+ req : http . ClientRequest ,
173
+ res : http . ServerResponse ,
173
174
next : ( error : MiddlewareError ) => void ,
174
175
) => void {
175
176
return function sentryErrorMiddleware (
176
177
error : MiddlewareError ,
177
- req : Request ,
178
- _res : Response ,
178
+ req : http . ClientRequest ,
179
+ _res : http . ServerResponse ,
179
180
next : ( error : MiddlewareError ) => void ,
180
181
) : void {
181
182
const status = getStatusCodeFromResponse ( error ) ;
0 commit comments