diff options
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/response.rs | 8 |
2 files changed, 8 insertions, 2 deletions
@@ -2,7 +2,7 @@ [package] name = "september" -version = "0.1.4" +version = "0.1.5" 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 d69efb2..702cfd5 100644 --- a/src/response.rs +++ b/src/response.rs @@ -92,7 +92,13 @@ pub async fn default( // Add a title to HTML response html_context.push_str(&format!("<title>{}</title>", gemini_title)); html_context.push_str("</head><body>"); - html_context.push_str(&gemini_html.1); + + match response.status { + gmi::protocol::StatusCode::Success(_) => + html_context.push_str(&gemini_html.1), + _ => html_context.push_str(&format!("<p>{}</p>", response.meta)), + } + // Add proxy information to footer of HTML response html_context.push_str(&format!( "<details>\n<summary>Proxy information</summary> |