@@ -98,8 +98,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
9898// Does the URL's refer to a non-routing host?
9999func isNonRoutingHost (url * url.URL ) bool {
100100 h := url .Hostname ()
101- switch h {
102- case "localhost" , "::1" :
101+ if h == "localhost" {
103102 return true
104103 }
105104
@@ -127,7 +126,7 @@ func parseRoutableHttpsUrl(urlString string) (*url.URL, error) {
127126 return url , nil
128127}
129128
130- func performHttpRequest (client * http. Client , ctx context. Context , method string , url string ) (* http.Response , error ) {
129+ func performHttpRequest (ctx context. Context , client * http. Client , method string , url string ) (* http.Response , error ) {
131130 req , err := http .NewRequestWithContext (ctx , method , url , nil )
132131 if err != nil {
133132 return nil , fmt .Errorf ("failed to create request: %w" , err )
@@ -169,7 +168,7 @@ func verifyMatch(ctx context.Context, client *http.Client, tokenString string) (
169168 }
170169
171170 // Fetch the OIDC discovery document
172- resp , err := performHttpRequest (client , ctx , "GET" , oidcDiscoveryURL .String ())
171+ resp , err := performHttpRequest (ctx , client , "GET" , oidcDiscoveryURL .String ())
173172 if err != nil {
174173 return nil , fmt .Errorf ("failed to perform OIDC discovery: %w" , err )
175174 }
@@ -196,7 +195,7 @@ func verifyMatch(ctx context.Context, client *http.Client, tokenString string) (
196195 }
197196
198197 // Fetch the JWKS
199- resp , err = performHttpRequest (client , ctx , "GET" , discoveryDoc .JWKSUri )
198+ resp , err = performHttpRequest (ctx , client , "GET" , discoveryDoc .JWKSUri )
200199 if err != nil {
201200 return nil , fmt .Errorf ("failed to fetch JWKS: %w" , err )
202201 }
0 commit comments