diff options
author | Andrew Hauck <[email protected]> | 2024-11-08 14:34:14 -0800 |
---|---|---|
committer | Yuchen Wu <[email protected]> | 2024-12-13 17:27:40 -0800 |
commit | a8a6e77eef2c0f4d2a45f00c5b0e316dd373f2f2 (patch) | |
tree | c5eb5e7b4e8b4c267de63f1c338365a09847a584 /pingora-proxy/src/proxy_trait.rs | |
parent | e309436319ed5cbc3aaf53221070a1fd070b8bcf (diff) | |
download | pingora-a8a6e77eef2c0f4d2a45f00c5b0e316dd373f2f2.tar.gz pingora-a8a6e77eef2c0f4d2a45f00c5b0e316dd373f2f2.zip |
Improve support for sending custom response headers and bodies for error messages
Diffstat (limited to 'pingora-proxy/src/proxy_trait.rs')
-rw-r--r-- | pingora-proxy/src/proxy_trait.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pingora-proxy/src/proxy_trait.rs b/pingora-proxy/src/proxy_trait.rs index 4017789..6970ec0 100644 --- a/pingora-proxy/src/proxy_trait.rs +++ b/pingora-proxy/src/proxy_trait.rs @@ -372,7 +372,6 @@ pub trait ProxyHttp { where Self::CTX: Send + Sync, { - let server_session = session.as_mut(); let code = match e.etype() { HTTPStatus(code) => *code, _ => { @@ -392,7 +391,9 @@ pub trait ProxyHttp { } }; if code > 0 { - server_session.respond_error(code).await + session.respond_error(code).await.unwrap_or_else(|e| { + error!("failed to send error response to downstream: {e}"); + }); } code } |