Skip to content

Commit 305e759

Browse files
committed
support protocol in ExpectedResponse
1 parent 040c2a0 commit 305e759

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

conformance/utils/http/http.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type Response struct {
9292
StatusCode int
9393
Headers map[string]string
9494
AbsentHeaders []string
95+
Protocol string
9596
}
9697

9798
type BackendRef struct {
@@ -270,6 +271,10 @@ func CompareRoundTrip(t *testing.T, req *roundtripper.Request, cReq *roundtrippe
270271
if expected.Response.StatusCode != cRes.StatusCode {
271272
return fmt.Errorf("expected status code to be %d, got %d. CRes: %v", expected.Response.StatusCode, cRes.StatusCode, cRes)
272273
}
274+
if expected.Response.Protocol != "" && expected.Response.Protocol != cRes.Protocol {
275+
return fmt.Errorf("expected protocol to be %s, got %s", expected.Response.Protocol, cRes.Protocol)
276+
}
277+
273278
if cRes.StatusCode == 200 {
274279
// The request expected to arrive at the backend is
275280
// the same as the request made, unless otherwise

0 commit comments

Comments
 (0)