From 1959930f7715046a80deba6c744a9870e740d579 Mon Sep 17 00:00:00 2001 From: Naseem Date: Thu, 16 Apr 2020 14:14:50 -0400 Subject: [PATCH] [http] fix: use url.URL (#960) url.URL from the standard library should be used instead of the global URL which comes from the dom lib. Signed-off-by: Naseem --- packages/opentelemetry-plugin-http/src/http.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opentelemetry-plugin-http/src/http.ts b/packages/opentelemetry-plugin-http/src/http.ts index 53bbebe5bb..51263cc89e 100644 --- a/packages/opentelemetry-plugin-http/src/http.ts +++ b/packages/opentelemetry-plugin-http/src/http.ts @@ -145,7 +145,7 @@ export class HttpPlugin extends BasePlugin { protected _getPatchOutgoingGetFunction( clientRequest: ( - options: RequestOptions | string | URL, + options: RequestOptions | string | url.URL, ...args: HttpRequestArgs ) => ClientRequest ) { @@ -161,7 +161,7 @@ export class HttpPlugin extends BasePlugin { // https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback // https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/plugins/plugin-http.ts#L198 return function outgoingGetRequest< - T extends RequestOptions | string | URL + T extends RequestOptions | string | url.URL >(options: T, ...args: HttpRequestArgs): ClientRequest { const req = clientRequest(options, ...args); req.end();