File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
packages/node-core/src/utils Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ import type { SanitizedRequestData } from '@sentry/core' ;
2+ import type { ClientRequest , RequestOptions } from 'http' ;
3+
4+ /** Convert an outgoing request to request options. */
5+ export function getRequestOptions ( request : ClientRequest ) : RequestOptions {
6+ return {
7+ method : request . method ,
8+ protocol : request . protocol ,
9+ host : request . host ,
10+ hostname : request . host ,
11+ path : request . path ,
12+ headers : request . getHeaders ( ) ,
13+ } ;
14+ }
15+
16+ /**
17+ *
18+ */
19+ export function getClientRequestUrl ( request : ClientRequest ) : string {
20+ const hostname = request . getHeader ( 'host' ) || request . host ;
21+ const protocol = request . protocol ;
22+ const path = request . path ;
23+
24+ return `${ protocol } //${ hostname } ${ path } ` ;
25+ }
You can’t perform that action at this time.
0 commit comments