diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 4 | ||||
| -rw-r--r-- | src/response.rs | 12 |
2 files changed, 14 insertions, 2 deletions
@@ -367,11 +367,11 @@ impl Router { "{}{}\r\n{}", response_status, match response_status { - 40 | 50 | 51 => &*content, + 10 | 11 | 40 | 50 | 51 => &*content, _ => " text/gemini; charset=utf-8", }, match response_status { - 40 | 50 | 51 => "".to_string(), + 10 | 11 | 40 | 50 | 51 => "".to_string(), _ => format!("{}{}{}", header, content, footer), } ) diff --git a/src/response.rs b/src/response.rs index 961cf79..cad2f1a 100644 --- a/src/response.rs +++ b/src/response.rs @@ -27,6 +27,8 @@ impl ToString for Header { } pub enum Response { + Input(String), + SensitiveInput(String), Success(String), NotFound(String), TemporaryFailure(String), @@ -38,6 +40,16 @@ pub(crate) fn to_value_set_status( status: &mut i32, ) -> String { match response { + Response::Input(value) => { + *status = 10; + + value + } + Response::SensitiveInput(value) => { + *status = 11; + + value + } Response::Success(value) => { *status = 20; |