diff options
| author | Fuwn <[email protected]> | 2022-07-09 01:41:19 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-07-09 01:41:19 +0000 |
| commit | d806185bdd41cd89159f5ab729710d84bbae2265 (patch) | |
| tree | 9d984c80f8f0de526523a320d562f8c3c94748e6 /src/router.rs | |
| parent | chore(cargo): republish with --all-features (diff) | |
| download | windmark-0.1.19.tar.xz windmark-0.1.19.zip | |
feat(response): success with mime responsev0.1.19
Diffstat (limited to 'src/router.rs')
| -rw-r--r-- | src/router.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/router.rs b/src/router.rs index 10a8f92..d4663f7 100644 --- a/src/router.rs +++ b/src/router.rs @@ -384,7 +384,10 @@ impl Router { .write_all( format!( "{}{}\r\n{}", - if response_status == 21 || response_status == 22 { + if response_status == 21 + || response_status == 22 + || response_status == 23 + { 20 } else { response_status @@ -395,14 +398,15 @@ impl Router { " text/gemini; charset={}; lang={}", self.charset, self.language ), + 21 => response_mime_type, #[cfg(feature = "auto-deduce-mime")] 22 => format!(" {}", tree_magic::from_u8(&*content.as_bytes())), - 21 => response_mime_type, + 23 => response_mime_type, _ => format!(" {}", content), }, match response_status { 20 => format!("{}{}\n{}", header, content, footer), - 21 | 22 => content.to_string(), + 21 | 22 | 23 => content.to_string(), _ => "".to_string(), } ) |