Skip to content

Commit 3f2b1ee

Browse files
authored
support protocol in ExpectedResponse (#3986)
1 parent da623ce commit 3f2b1ee

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
@@ -94,6 +94,7 @@ type Response struct {
9494
StatusCode int
9595
Headers map[string]string
9696
AbsentHeaders []string
97+
Protocol string
9798
}
9899

99100
type BackendRef struct {
@@ -306,6 +307,10 @@ func CompareRoundTrip(t *testing.T, req *roundtripper.Request, cReq *roundtrippe
306307
if expected.Response.StatusCode != cRes.StatusCode {
307308
return fmt.Errorf("expected status code to be %d, got %d. CRes: %v", expected.Response.StatusCode, cRes.StatusCode, cRes)
308309
}
310+
if expected.Response.Protocol != "" && expected.Response.Protocol != cRes.Protocol {
311+
return fmt.Errorf("expected protocol to be %s, got %s", expected.Response.Protocol, cRes.Protocol)
312+
}
313+
309314
if cRes.StatusCode == 200 {
310315
// The request expected to arrive at the backend is
311316
// the same as the request made, unless otherwise

0 commit comments

Comments
 (0)