@@ -17,33 +17,8 @@ import * as http from 'http';
1717import * as https from 'https' ;
1818import { URL } from 'url' ;
1919
20- import { SDK_NAME } from '../version' ;
21-
22- /**
23- * Internal used interface for typescript.
24- * @hidden
25- */
26- export interface HTTPModule {
27- /**
28- * Request wrapper
29- * @param options These are {@see TransportOptions}
30- * @param callback Callback when request is finished
31- */
32- request (
33- options : http . RequestOptions | https . RequestOptions | string | URL ,
34- callback ?: ( res : http . IncomingMessage ) => void ,
35- ) : http . ClientRequest ;
36-
37- // This is the type for nodejs versions that handle the URL argument
38- // (v10.9.0+), but we do not use it just yet because we support older node
39- // versions:
40-
41- // request(
42- // url: string | URL,
43- // options: http.RequestOptions | https.RequestOptions,
44- // callback?: (res: http.IncomingMessage) => void,
45- // ): http.ClientRequest;
46- }
20+ import { SDK_NAME } from '../../version' ;
21+ import { HTTPModule } from './http-module' ;
4722
4823export type URLParts = Pick < URL , 'hostname' | 'pathname' | 'port' | 'protocol' > ;
4924export type UrlParser = ( url : string ) => URLParts ;
@@ -231,7 +206,7 @@ export abstract class BaseTransport implements Transport {
231206 throw new SentryError ( 'No module available' ) ;
232207 }
233208 const options = this . _getRequestOptions ( this . urlParser ( sentryReq . url ) ) ;
234- const req = this . module . request ( options , ( res : http . IncomingMessage ) => {
209+ const req = this . module . request ( options , res => {
235210 const statusCode = res . statusCode || 500 ;
236211 const status = Status . fromHttpCode ( statusCode ) ;
237212
0 commit comments