aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-05-30 07:55:44 +0000
committerFuwn <[email protected]>2023-05-30 07:55:44 +0000
commite5d510fcba92d9f79c38c0d3b5a79f39a1fbca71 (patch)
tree75336fe0b89d4b71822ab35700652a67a69ad015
parentci(docker): remove problematic sccache (diff)
downloadseptember-e5d510fcba92d9f79c38c0d3b5a79f39a1fbca71.tar.xz
september-e5d510fcba92d9f79c38c0d3b5a79f39a1fbca71.zip
fix(response): header only on non-proxy routesv0.2.8
-rw-r--r--Cargo.toml2
-rw-r--r--src/response.rs8
2 files changed, 6 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index bbc3f94..c5c0325 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
[package]
name = "september"
-version = "0.2.7"
+version = "0.2.8"
authors = ["Fuwn <[email protected]>"]
edition = "2021"
description = "A simple and efficient Gemini-to-HTTP proxy."
diff --git a/src/response.rs b/src/response.rs
index f156603..6024b0a 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -184,9 +184,11 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".<
html_context.push_str(&format!("<title>{gemini_title}</title>"));
html_context.push_str("</head><body>");
- if let Ok(header) = var("HEADER") {
- html_context
- .push_str(&format!("<big><blockquote>{header}</blockquote></big>"));
+ if !req.path().starts_with("/proxy") {
+ if let Ok(header) = var("HEADER") {
+ html_context
+ .push_str(&format!("<big><blockquote>{header}</blockquote></big>"));
+ }
}
match response.status() {