From 026f4837121ab8f3ce186a66eff91db2c190f16d Mon Sep 17 00:00:00 2001 From: Zaidoon Abd Al Hadi Date: Thu, 16 May 2024 01:07:14 -0400 Subject: [PATCH] expose session to cache_hit_filter phase --- .bleep | 2 +- pingora-proxy/src/proxy_cache.rs | 6 +----- pingora-proxy/src/proxy_trait.rs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.bleep b/.bleep index 5bb8a00..a2a2187 100644 --- a/.bleep +++ b/.bleep @@ -1 +1 @@ -d44d3b13cb33c5163561923a94d62baed216767d \ No newline at end of file +b0438fe62f4b4004646ca3621a0c0215c6385f6f \ No newline at end of file diff --git a/pingora-proxy/src/proxy_cache.rs b/pingora-proxy/src/proxy_cache.rs index 00b61da..1611f59 100644 --- a/pingora-proxy/src/proxy_cache.rs +++ b/pingora-proxy/src/proxy_cache.rs @@ -116,11 +116,7 @@ impl HttpProxy { // (this is a soft purge which tries to revalidate, // vs. hard purge which forces miss) // TODO: allow hard purge - match self - .inner - .cache_hit_filter(&meta, ctx, session.req_header()) - .await - { + match self.inner.cache_hit_filter(session, &meta, ctx).await { Err(e) => { error!( "Failed to filter cache hit: {e}, {}", diff --git a/pingora-proxy/src/proxy_trait.rs b/pingora-proxy/src/proxy_trait.rs index adeddd8..307280c 100644 --- a/pingora-proxy/src/proxy_trait.rs +++ b/pingora-proxy/src/proxy_trait.rs @@ -109,9 +109,9 @@ pub trait ProxyHttp { // flex purge, other filtering, returns whether asset is should be force expired or not async fn cache_hit_filter( &self, + _session: &Session, _meta: &CacheMeta, _ctx: &mut Self::CTX, - _req: &RequestHeader, ) -> Result where Self::CTX: Send + Sync,