diff options
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/response.rs | 14 | ||||
| -rw-r--r-- | src/url.rs | 1 |
3 files changed, 16 insertions, 1 deletions
@@ -2,7 +2,7 @@ [package] name = "september" -version = "0.2.11" +version = "0.2.12" 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 345f6f5..717da4c 100644 --- a/src/response.rs +++ b/src/response.rs @@ -201,6 +201,20 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".< germ::request::Status::Success => { html_context.push_str(&gemini_html.1); } + germ::request::Status::PermanentRedirect => { + html_context.push_str(&format!( + "<p>This page permanently redirects to <a href=\"{}\">{}</a>.</p>", + response.meta(), + response.meta().trim() + )); + } + germ::request::Status::TemporaryRedirect => { + html_context.push_str(&format!( + "<p>This page temporarily redirects to <a href=\"{}\">{}</a>.</p>", + response.meta(), + response.meta().trim() + )); + } _ => html_context.push_str(&format!("<p>{}</p>", response.meta())), } @@ -25,6 +25,7 @@ pub fn make( is_nocss: &mut bool, ) -> Result<Url, url::ParseError> { Ok( + #[allow(clippy::blocks_in_conditions)] match Url::try_from(&*if path.starts_with("/proxy") { *is_proxy = true; |