diff options
author | Andrew Hauck <[email protected]> | 2024-04-12 16:56:57 -0700 |
---|---|---|
committer | Kevin Guthrie <[email protected]> | 2024-04-26 12:31:57 -0400 |
commit | a6bd816f169cbcaecdcc51f918026ed0dbc830ea (patch) | |
tree | 378046ecb90983369babdfcd93a876fec54d659b /pingora-proxy/src/lib.rs | |
parent | 93ad08ea3ea4c2895f9c71d72b81c40482358387 (diff) | |
download | pingora-a6bd816f169cbcaecdcc51f918026ed0dbc830ea.tar.gz pingora-a6bd816f169cbcaecdcc51f918026ed0dbc830ea.zip |
Add support for downstream h2 trailers and add an upstream h2 response trailer filter
Diffstat (limited to 'pingora-proxy/src/lib.rs')
-rw-r--r-- | pingora-proxy/src/lib.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pingora-proxy/src/lib.rs b/pingora-proxy/src/lib.rs index 930087d..453e9dd 100644 --- a/pingora-proxy/src/lib.rs +++ b/pingora-proxy/src/lib.rs @@ -222,7 +222,12 @@ impl<SV> HttpProxy<SV> { } } - fn upstream_filter(&self, session: &mut Session, task: &mut HttpTask, ctx: &mut SV::CTX) + fn upstream_filter( + &self, + session: &mut Session, + task: &mut HttpTask, + ctx: &mut SV::CTX, + ) -> Result<()> where SV: ProxyHttp, { @@ -233,10 +238,14 @@ impl<SV> HttpProxy<SV> { HttpTask::Body(data, eos) => self .inner .upstream_response_body_filter(session, data, *eos, ctx), + HttpTask::Trailer(Some(trailers)) => self + .inner + .upstream_response_trailer_filter(session, trailers, ctx)?, _ => { - // TODO: add other upstream filter traits + // task does not support a filter } } + Ok(()) } async fn finish( |