mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
fix redirect status detection
This commit is contained in:
parent
a26e59d642
commit
8e516b534d
2 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ggemini"
|
name = "ggemini"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,14 @@ use glib::GString;
|
||||||
/// https://geminiprotocol.net/docs/protocol-specification.gmi#status-codes
|
/// https://geminiprotocol.net/docs/protocol-specification.gmi#status-codes
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Status {
|
pub enum Status {
|
||||||
|
// 10 | 11
|
||||||
Input,
|
Input,
|
||||||
SensitiveInput,
|
SensitiveInput,
|
||||||
|
// 20
|
||||||
Success,
|
Success,
|
||||||
|
// 30 | 31
|
||||||
Redirect,
|
Redirect,
|
||||||
|
PermanentRedirect,
|
||||||
} // @TODO
|
} // @TODO
|
||||||
|
|
||||||
impl Status {
|
impl Status {
|
||||||
|
|
@ -28,6 +32,8 @@ impl Status {
|
||||||
"10" => Ok(Self::Input),
|
"10" => Ok(Self::Input),
|
||||||
"11" => Ok(Self::SensitiveInput),
|
"11" => Ok(Self::SensitiveInput),
|
||||||
"20" => Ok(Self::Success),
|
"20" => Ok(Self::Success),
|
||||||
|
"30" => Ok(Self::Redirect),
|
||||||
|
"31" => Ok(Self::PermanentRedirect),
|
||||||
_ => Err(Error::Undefined),
|
_ => Err(Error::Undefined),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue