forked from quic-go/quic-go
add a http3.RoundTripOpt to skip the request scheme check
Otherwise, we'll only be able to issue https requests. This is what we usually want, but for MASQUE support, the URL will be of the form masque://example.org.
This commit is contained in:
@@ -179,6 +179,15 @@ var _ = Describe("RoundTripper", func() {
|
||||
Expect(req.Body.(*mockBody).closed).To(BeTrue())
|
||||
})
|
||||
|
||||
It("allow non-https schemes if SkipSchemeCheck is set", func() {
|
||||
req, err := http.NewRequest("GET", "masque://www.example.org/", nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
_, err = rt.RoundTrip(req)
|
||||
Expect(err).To(MatchError("http3: unsupported protocol scheme: masque"))
|
||||
_, err = rt.RoundTripOpt(req, RoundTripOpt{SkipSchemeCheck: true, OnlyCachedConn: true})
|
||||
Expect(err).To(MatchError("http3: no cached connection was available"))
|
||||
})
|
||||
|
||||
It("rejects requests without a URL", func() {
|
||||
req1.URL = nil
|
||||
req1.Body = &mockBody{}
|
||||
|
||||
Reference in New Issue
Block a user