@@ -17,33 +17,8 @@ import * as http from 'http';
17
17
import * as https from 'https' ;
18
18
import { URL } from 'url' ;
19
19
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' ;
47
22
48
23
export type URLParts = Pick < URL , 'hostname' | 'pathname' | 'port' | 'protocol' > ;
49
24
export type UrlParser = ( url : string ) => URLParts ;
@@ -231,7 +206,7 @@ export abstract class BaseTransport implements Transport {
231
206
throw new SentryError ( 'No module available' ) ;
232
207
}
233
208
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 => {
235
210
const statusCode = res . statusCode || 500 ;
236
211
const status = Status . fromHttpCode ( statusCode ) ;
237
212
0 commit comments