You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Remove CancelRequest implementation, tracking of request copies.
In older versions of Go and net/http standard library, implementations
of http.RoundTripper had to implement CancelRequest method in order to
enable request cancellation. That CancelRequest method has since been
deprecated in favor of more modern ways of request cancellation, which
is via Request.Cancel field and/or request context. Modern http.Client
uses Request.Cancel field to implement its Timeout field, but also calls
the deprecated CancelRequest method, if it's implemented, just in case.
Since this package is expected to run on modern versions of Go (it
requires Go 1.6+ at this time), we can safely remove the deprecated
CancelRequest method implementation.
The benefits of doing that include:
- Remove the unneeded "httpcache: Client Transport of type %T doesn't
support CancelRequest; Timeout not supported" warning from being
logged.
- Simplify and remove code for tracking the mapping between the
original and copied request, which was only needed by the
implementation of the CancelRequest method.
- onEOFReader also becomes unused, and can be removed.
Add a simple timeout test to verify that http.Client.Timeout value is
respected when a cache transport is used.
Skip this test in short mode, because it takes at least 3 seconds to
run, to test timeouts. This is significantly longer than other tests.
Resolves #61.
Updates #62.
0 commit comments