Merge pull request #753 from lucas-clemente/fix-734

implement a h2quic.RoundTripOpt that allow to only use cached QUIC conns
This commit is contained in:
Marten Seemann
2017-07-25 08:36:51 +07:00
committed by GitHub
2 changed files with 36 additions and 5 deletions

View File

@@ -115,6 +115,13 @@ var _ = Describe("RoundTripper", func() {
Expect(err).To(MatchError(streamOpenErr))
Expect(rt.clients).To(HaveLen(1))
})
It("doesn't create new clients if RoundTripOpt.OnlyCachedConn is set", func() {
req, err := http.NewRequest("GET", "https://quic.clemente.io/foobar.html", nil)
Expect(err).ToNot(HaveOccurred())
_, err = rt.RoundTripOpt(req, RoundTripOpt{OnlyCachedConn: true})
Expect(err).To(MatchError(ErrNoCachedConn))
})
})
Context("validating request", func() {