aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs4
-rw-r--r--src/response.rs6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f9d1d31..f532679 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -367,11 +367,11 @@ impl Router {
"{}{}\r\n{}",
response_status,
match response_status {
- 50 | 51 => &*content,
+ 40 | 50 | 51 => &*content,
_ => " text/gemini; charset=utf-8",
},
match response_status {
- 50 | 51 => "".to_string(),
+ 40 | 50 | 51 => "".to_string(),
_ => format!("{}{}{}", header, content, footer),
}
)
diff --git a/src/response.rs b/src/response.rs
index 0a4b79e..961cf79 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -29,6 +29,7 @@ impl ToString for Header {
pub enum Response {
Success(String),
NotFound(String),
+ TemporaryFailure(String),
PermanentFailure(String),
}
@@ -42,6 +43,11 @@ pub(crate) fn to_value_set_status(
value
}
+ Response::TemporaryFailure(value) => {
+ *status = 40;
+
+ value
+ }
Response::NotFound(value) => {
*status = 51;