@@ -5,6 +5,7 @@ import { forget } from '@sentry/utils/async';
55import { serialize } from '@sentry/utils/object' ;
66import { parse as parseCookie } from 'cookie' ;
77import * as domain from 'domain' ;
8+ import * as http from 'http' ;
89import { hostname } from 'os' ;
910import { parse as parseUrl } from 'url' ;
1011import { NodeClient } from './client' ;
@@ -135,8 +136,8 @@ function parseRequest(
135136}
136137
137138/** 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 {
140141 const local = domain . create ( ) ;
141142 const hub = getHubFromCarrier ( req ) ;
142143 hub . bindClient ( getCurrentHub ( ) . getClient ( ) ) ;
@@ -168,14 +169,14 @@ function getStatusCodeFromResponse(error: MiddlewareError): number {
168169/** JSDoc */
169170export function errorHandler ( ) : (
170171 error : MiddlewareError ,
171- req : Request ,
172- res : Response ,
172+ req : http . ClientRequest ,
173+ res : http . ServerResponse ,
173174 next : ( error : MiddlewareError ) => void ,
174175) => void {
175176 return function sentryErrorMiddleware (
176177 error : MiddlewareError ,
177- req : Request ,
178- _res : Response ,
178+ req : http . ClientRequest ,
179+ _res : http . ServerResponse ,
179180 next : ( error : MiddlewareError ) => void ,
180181 ) : void {
181182 const status = getStatusCodeFromResponse ( error ) ;
0 commit comments