[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 <naseem@transit.app>
This commit is contained in:
parent
7412d9b518
commit
1959930f77
|
@ -145,7 +145,7 @@ export class HttpPlugin extends BasePlugin<Http> {
|
||||||
|
|
||||||
protected _getPatchOutgoingGetFunction(
|
protected _getPatchOutgoingGetFunction(
|
||||||
clientRequest: (
|
clientRequest: (
|
||||||
options: RequestOptions | string | URL,
|
options: RequestOptions | string | url.URL,
|
||||||
...args: HttpRequestArgs
|
...args: HttpRequestArgs
|
||||||
) => ClientRequest
|
) => ClientRequest
|
||||||
) {
|
) {
|
||||||
|
@ -161,7 +161,7 @@ export class HttpPlugin extends BasePlugin<Http> {
|
||||||
// https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback
|
// 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
|
// https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/plugins/plugin-http.ts#L198
|
||||||
return function outgoingGetRequest<
|
return function outgoingGetRequest<
|
||||||
T extends RequestOptions | string | URL
|
T extends RequestOptions | string | url.URL
|
||||||
>(options: T, ...args: HttpRequestArgs): ClientRequest {
|
>(options: T, ...args: HttpRequestArgs): ClientRequest {
|
||||||
const req = clientRequest(options, ...args);
|
const req = clientRequest(options, ...args);
|
||||||
req.end();
|
req.end();
|
||||||
|
|
Loading…
Reference in New Issue