From 2cd37eb3edaed196bd550ad4e03a782c5a9af2ef Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 2 Jun 2022 01:09:15 +0000 Subject: feat(response): show meta when non-success response --- src/response.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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!("{}", gemini_title)); html_context.push_str(""); - 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!("

{}

", response.meta)), + } + // Add proxy information to footer of HTML response html_context.push_str(&format!( "
\nProxy information -- cgit v1.2.3