From dfbaff0e775436b7b90b57381df2740cfbdacfb7 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 30 May 2023 07:55:44 +0000 Subject: fix(response): header only on non-proxy routes --- Cargo.toml | 2 +- src/response.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 671a6e1..236f4c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "september" -version = "0.2.7" +version = "0.2.8" authors = ["Fuwn "] 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!("{gemini_title}")); html_context.push_str(""); - if let Ok(header) = var("HEADER") { - html_context - .push_str(&format!("
{header}
")); + if !req.path().starts_with("/proxy") { + if let Ok(header) = var("HEADER") { + html_context + .push_str(&format!("
{header}
")); + } } match response.status() { -- cgit v1.2.3