@@ -23,7 +23,7 @@ export class Fetch implements Wrapper {
2323 // Let the agent know that we are connecting to this hostname
2424 // This is to build a list of all hostnames that the application is connecting to
2525 if ( typeof port === "number" && port > 0 ) {
26- agent . onConnectHostname ( url , port ) ;
26+ agent . onConnectHostname ( url . hostname , port ) ;
2727 agent . onConnectHTTP ( url , port , method ) ;
2828 }
2929 const context = getContext ( ) ;
@@ -57,7 +57,12 @@ export class Fetch implements Wrapper {
5757 if ( typeof args [ 0 ] === "string" && args [ 0 ] . length > 0 ) {
5858 const url = tryParseURL ( args [ 0 ] ) ;
5959 if ( url ) {
60- const attack = this . inspectHostname ( agent , url , getPortFromURL ( url ) , method ) ;
60+ const attack = this . inspectHostname (
61+ agent ,
62+ url ,
63+ getPortFromURL ( url ) ,
64+ method
65+ ) ;
6166 if ( attack ) {
6267 return attack ;
6368 }
@@ -71,7 +76,12 @@ export class Fetch implements Wrapper {
7176 if ( Array . isArray ( args [ 0 ] ) ) {
7277 const url = tryParseURL ( args [ 0 ] . toString ( ) ) ;
7378 if ( url ) {
74- const attack = this . inspectHostname ( agent , url , getPortFromURL ( url ) , method ) ;
79+ const attack = this . inspectHostname (
80+ agent ,
81+ url ,
82+ getPortFromURL ( url ) ,
83+ method
84+ ) ;
7585 if ( attack ) {
7686 return attack ;
7787 }
@@ -95,7 +105,12 @@ export class Fetch implements Wrapper {
95105 if ( args [ 0 ] instanceof Request ) {
96106 const url = tryParseURL ( args [ 0 ] . url ) ;
97107 if ( url ) {
98- const attack = this . inspectHostname ( agent , url , getPortFromURL ( url ) , method ) ;
108+ const attack = this . inspectHostname (
109+ agent ,
110+ url ,
111+ getPortFromURL ( url ) ,
112+ method
113+ ) ;
99114 if ( attack ) {
100115 return attack ;
101116 }
0 commit comments