forked from quic-go/quic-go
Currently, the implementation of h2quic.RoundTripper.RoundTrip(req
*http.Request) ignores the context of req. As a result, if the
RoundTripper is used as transport of an http.Client with a timeout value
set, that is ignored.
For example, in the following snippet, client.Do(req) does not promptly
return if the task takes more than client.Timeout to complete.
client := http.Client{
Timeout: 50 * time.Millisecond,
Transport = &h2quic.RoundTripper{}
}
req, err := http.NewRequest("GET", "https://www.example.com", nil)
response, err := client.Do(req)
This commit updates h2quic.client.RoundTrip(req *http.Request) to return
an error if the request is cancelled.
5.1 KiB
5.1 KiB