diff --git a/h2quic/client.go b/h2quic/client.go index 91e33791c..c0a711731 100644 --- a/h2quic/client.go +++ b/h2quic/client.go @@ -144,8 +144,7 @@ func (c *client) Do(req *http.Request) (*http.Response, error) { return nil, errors.New("quic http2: unsupported scheme") } if authorityAddr("https", hostnameFromRequest(req)) != c.hostname { - utils.Debugf("%s vs %s", req.Host, c.hostname) - return nil, errors.New("h2quic Client BUG: Do called for the wrong client") + return nil, fmt.Errorf("h2quic Client BUG: RoundTrip called for the wrong client (expected %s, got %s)", c.hostname, req.Host) } hasBody := (req.Body != nil) diff --git a/h2quic/client_test.go b/h2quic/client_test.go index a9451f5aa..890a27079 100644 --- a/h2quic/client_test.go +++ b/h2quic/client_test.go @@ -212,7 +212,7 @@ var _ = Describe("Client", func() { req, err := http.NewRequest("https", "https://quic.clemente.io:1336/foobar.html", nil) Expect(err).ToNot(HaveOccurred()) _, err = client.Do(req) - Expect(err).To(MatchError("h2quic Client BUG: Do called for the wrong client")) + Expect(err).To(MatchError("h2quic Client BUG: RoundTrip called for the wrong client (expected quic.clemente.io:1337, got quic.clemente.io:1336)")) }) It("refuses to do plain HTTP requests", func() {