Closed matt-phylum closed 10 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
937e587
) 92.64% compared to head (9b0ff54
) 92.90%. Report is 5 commits behind head on develop.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Nice, looks great! Thanks again for the contribution
This PR allows users of
http-cache-reqwest
to override the cache mode on a per-request basis usingreqwest-middleware
's extension mechanism. Forcache_mode_fn
, the request parts need to have some recognizable characteristic that is known ahead of time, or thecache_mode_fn
implementation needs to have some shared mutable state that allows recognizable requests to be registered on the fly. With request extensions, the caller can simply specify something like.with_extension(CacheMode::Reload)
when building the request and just that request will be affected, even if it has the exact same parts as another request.Other middleware implementations can implement a similar feature by providing an implementation for the new
overridden_cache_mode
function, but I don't know of an equivalent capability for surf so I didn't implement this feature there.