aboutsummaryrefslogtreecommitdiff
path: root/src/response.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-06-02 01:09:15 +0000
committerFuwn <[email protected]>2022-06-02 01:09:15 +0000
commit2cd37eb3edaed196bd550ad4e03a782c5a9af2ef (patch)
tree9835cc6a75603ae2aad6e4e4ec3737c865a395ff /src/response.rs
parentfeat(response): plain text routes (diff)
downloadseptember-2cd37eb3edaed196bd550ad4e03a782c5a9af2ef.tar.xz
september-2cd37eb3edaed196bd550ad4e03a782c5a9af2ef.zip
feat(response): show meta when non-success response
Diffstat (limited to 'src/response.rs')
-rw-r--r--src/response.rs8
1 files changed, 7 insertions, 1 deletions
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>