Skip to content

Commit 40a26ea

Browse files
authored
Merge pull request #2280 from shawnh2/fix-http-redirect-request-scheme-check
fix: add check for unrecognized scheme in http redirect request scheme
2 parents 444631b + 7b69ccd commit 40a26ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

conformance/utils/http/http.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,9 @@ func CompareRequest(t *testing.T, req *roundtripper.Request, cReq *roundtripper.
366366
if strings.ToLower(cRes.RedirectRequest.Scheme) == "https" && gotPort != "443" && gotPort != "" {
367367
return fmt.Errorf("for https scheme, expected redirected port to be 443 or not set, got %q", gotPort)
368368
}
369-
t.Logf("Can't validate redirectPort for unrecognized scheme %v", cRes.RedirectRequest.Scheme)
369+
if strings.ToLower(cRes.RedirectRequest.Scheme) != "http" || strings.ToLower(cRes.RedirectRequest.Scheme) != "https" {
370+
t.Logf("Can't validate redirectPort for unrecognized scheme %v", cRes.RedirectRequest.Scheme)
371+
}
370372
} else if expected.RedirectRequest.Port != gotPort {
371373
// An expected port was specified in the tests but it didn't match with
372374
// gotPort.

0 commit comments

Comments
 (0)