diff options
author | Armael <armael@noreply.localhost> | 2024-12-01 15:31:13 +0000 |
---|---|---|
committer | Armael <armael@noreply.localhost> | 2024-12-01 15:31:13 +0000 |
commit | 2a679f97b63a3f86da93934059765d99739909a8 (patch) | |
tree | 08aa71f65356a324d411d33a2d1fd02053047cdf | |
parent | 7540b03cf6200820520b2d8a9a13aa3277d81d91 (diff) | |
parent | e89f3b67bd00f9e30db531e2b346fe485e27d1d6 (diff) | |
download | tricot-2a679f97b63a3f86da93934059765d99739909a8.tar.gz tricot-2a679f97b63a3f86da93934059765d99739909a8.zip |
Merge pull request 'reverse proxy: also add tag-based headers for redirections' (#17) from Armael/tricot:headers_for_redirects into mainHEADmain
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/tricot/pulls/17
-rw-r--r-- | src/https.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/https.rs b/src/https.rs index 9d92470..78190b4 100644 --- a/src/https.rs +++ b/src/https.rs @@ -371,8 +371,8 @@ async fn do_proxy( reverse_proxy::call(remote_addr.ip(), &to_addr, req).await? }; - if response.status().is_success() { - // (TODO: maybe we want to add these headers even if it's not a success?) + if response.status().is_success() || response.status().is_redirection() { + // (TODO: maybe we want to add these headers even if it's not a success or redirection?) for (header, value) in proxy_to.add_headers.iter() { response.headers_mut().insert( HeaderName::from_bytes(header.as_bytes())?, |