Skip to content

Commit

Permalink
fix redirect status detection
Browse files Browse the repository at this point in the history
  • Loading branch information
yggverse committed Oct 28, 2024
1 parent a26e59d commit 8e516b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ggemini"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
license = "MIT"
readme = "README.md"
Expand Down
6 changes: 6 additions & 0 deletions src/client/response/header/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ use glib::GString;
/// https://geminiprotocol.net/docs/protocol-specification.gmi#status-codes
#[derive(Debug)]
pub enum Status {
// 10 | 11
Input,
SensitiveInput,
// 20
Success,
// 30 | 31
Redirect,
PermanentRedirect,
} // @TODO

impl Status {
Expand All @@ -28,6 +32,8 @@ impl Status {
"10" => Ok(Self::Input),
"11" => Ok(Self::SensitiveInput),
"20" => Ok(Self::Success),
"30" => Ok(Self::Redirect),
"31" => Ok(Self::PermanentRedirect),
_ => Err(Error::Undefined),
}
}
Expand Down

0 comments on commit 8e516b5

Please sign in to comment.