Skip to content

Commit b856e99

Browse files
committed
add check for unrecognized scheme in http redirect request check
Signed-off-by: sh2 <[email protected]>
1 parent 7007d1b commit b856e99

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
@@ -345,7 +345,9 @@ func CompareRequest(t *testing.T, req *roundtripper.Request, cReq *roundtripper.
345345
if strings.ToLower(cRes.RedirectRequest.Scheme) == "https" && gotPort != "443" && gotPort != "" {
346346
return fmt.Errorf("for https scheme, expected redirected port to be 443 or not set, got %q", gotPort)
347347
}
348-
t.Logf("Can't validate redirectPort for unrecognized scheme %v", cRes.RedirectRequest.Scheme)
348+
if strings.ToLower(cRes.RedirectRequest.Scheme) != "http" || strings.ToLower(cRes.RedirectRequest.Scheme) == "https" {
349+
t.Logf("Can't validate redirectPort for unrecognized scheme %v", cRes.RedirectRequest.Scheme)
350+
}
349351
} else if expected.RedirectRequest.Port != gotPort {
350352
// An expected port was specified in the tests but it didn't match with
351353
// gotPort.

0 commit comments

Comments
 (0)