diff options
author | Matthew Gumport <[email protected]> | 2024-12-13 15:07:12 -0800 |
---|---|---|
committer | Matthew Gumport <[email protected]> | 2024-12-13 15:07:12 -0800 |
commit | a5c03fa60ac0a5b814ea9082474dd17667a4571b (patch) | |
tree | 5130d44671578701f3d1c66f95804aface7e236d /pingora-proxy/src/proxy_cache.rs | |
parent | c429adaad6564e544659dedf316ee0d94e8a98c6 (diff) | |
download | pingora-bleeper-yuchen-9df2f3f6e6b919a632b08af4584a1c1a3bcee0fd.tar.gz pingora-bleeper-yuchen-9df2f3f6e6b919a632b08af4584a1c1a3bcee0fd.zip |
add range_header_filter to proxy traitbleeper-yuchen-9df2f3f6e6b919a632b08af4584a1c1a3bcee0fd
This makes the `range_header_filter` overridable. The new default implementation
is what we were doing instead of calling a hook.
Diffstat (limited to 'pingora-proxy/src/proxy_cache.rs')
-rw-r--r-- | pingora-proxy/src/proxy_cache.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pingora-proxy/src/proxy_cache.rs b/pingora-proxy/src/proxy_cache.rs index 454416e..b393780 100644 --- a/pingora-proxy/src/proxy_cache.rs +++ b/pingora-proxy/src/proxy_cache.rs @@ -279,7 +279,7 @@ impl<SV> HttpProxy<SV> { // process range header if the cache storage supports seek let range_type = if seekable && !session.ignore_downstream_range { - range_header_filter(req, &mut header) + self.inner.range_header_filter(req, &mut header, ctx) } else { RangeType::None }; @@ -826,7 +826,7 @@ fn cache_hit_header(cache: &HttpCache) -> Box<ResponseHeader> { } // https://datatracker.ietf.org/doc/html/rfc7233#section-3 -pub(crate) mod range_filter { +pub mod range_filter { use super::*; use http::header::*; use std::ops::Range; |