forked from quic-go/quic-go
http3: expose an OpenStream method on the RoundTripper (#4409)
The stream exposes two methods required for doing an HTTP request: SendRequestHeader and ReadResponse. This can be used by applications that wish to use the stream for non-HTTP content afterwards. This will lead to a simplification in the API we need to expose for WebTransport, and will make it easier to send HTTP Datagrams associated with this stream.
This commit is contained in:
@@ -293,21 +293,12 @@ var _ = Describe("Request", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("uses req.URL.Host", func() {
|
||||
req := &http.Request{URL: url}
|
||||
Expect(hostnameFromRequest(req)).To(Equal("quic.clemente.io:1337"))
|
||||
})
|
||||
|
||||
It("uses req.URL.Host even if req.Host is available", func() {
|
||||
req := &http.Request{
|
||||
Host: "www.example.org",
|
||||
URL: url,
|
||||
}
|
||||
Expect(hostnameFromRequest(req)).To(Equal("quic.clemente.io:1337"))
|
||||
It("uses URL.Host", func() {
|
||||
Expect(hostnameFromURL(url)).To(Equal("quic.clemente.io:1337"))
|
||||
})
|
||||
|
||||
It("returns an empty hostname if nothing is set", func() {
|
||||
Expect(hostnameFromRequest(&http.Request{})).To(BeEmpty())
|
||||
Expect(hostnameFromURL(nil)).To(BeEmpty())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user