mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
add 61, 62 status codes handle, show server-side message on failure
This commit is contained in:
parent
a0566fba30
commit
69142fa60f
@ -59,10 +59,10 @@ GTK 4 / Libadwaita client written in Rust
|
|||||||
* [ ] `52` Gone
|
* [ ] `52` Gone
|
||||||
* [ ] `53` Proxy request refused
|
* [ ] `53` Proxy request refused
|
||||||
* [ ] `59` Bad request
|
* [ ] `59` Bad request
|
||||||
* [ ] Client certificates
|
* [x] Client certificates
|
||||||
* [x] `60` Certificate requested
|
* [x] `60` Certificate requested
|
||||||
* [ ] `61` Certificate not authorized
|
* [x] `61` Certificate not authorized
|
||||||
* [ ] `62` Certificate not valid
|
* [x] `62` Certificate not valid
|
||||||
* [x] [Gemtext](https://geminiprotocol.net/docs/gemtext-specification.gmi) (by [ggemtext](https://github.com/YGGverse/ggemtext))
|
* [x] [Gemtext](https://geminiprotocol.net/docs/gemtext-specification.gmi) (by [ggemtext](https://github.com/YGGverse/ggemtext))
|
||||||
* [x] Code (inline/multiline)
|
* [x] Code (inline/multiline)
|
||||||
* [x] Inline
|
* [x] Inline
|
||||||
|
@ -859,7 +859,11 @@ impl Page {
|
|||||||
update.activate(Some(&id));
|
update.activate(Some(&id));
|
||||||
},
|
},
|
||||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-60
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-60
|
||||||
gemini::client::response::meta::Status::CertificateRequest => {
|
gemini::client::response::meta::Status::CertificateRequest |
|
||||||
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-61
|
||||||
|
gemini::client::response::meta::Status::CertificateUnauthorized |
|
||||||
|
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-62
|
||||||
|
gemini::client::response::meta::Status::CertificateInvalid => {
|
||||||
// Define common data
|
// Define common data
|
||||||
let status = Status::Success;
|
let status = Status::Success;
|
||||||
let title = "Identity";
|
let title = "Identity";
|
||||||
@ -867,7 +871,11 @@ impl Page {
|
|||||||
// Update widget
|
// Update widget
|
||||||
content
|
content
|
||||||
.to_status_identity()
|
.to_status_identity()
|
||||||
.set_title(title);
|
.set_title(title)
|
||||||
|
.set_description(match response.data() {
|
||||||
|
Some(data) => Some(data.value().as_str()),
|
||||||
|
None => None,
|
||||||
|
});
|
||||||
|
|
||||||
// Update meta
|
// Update meta
|
||||||
meta.set_status(status)
|
meta.set_status(status)
|
||||||
@ -885,7 +893,10 @@ impl Page {
|
|||||||
content
|
content
|
||||||
.to_status_failure()
|
.to_status_failure()
|
||||||
.set_title(title)
|
.set_title(title)
|
||||||
.set_description(Some("Status code yet not supported"));
|
.set_description(Some(match response.data() {
|
||||||
|
Some(data) => data.value().as_str(),
|
||||||
|
None => "Status code yet not supported", // @TODO
|
||||||
|
}));
|
||||||
|
|
||||||
// Update meta
|
// Update meta
|
||||||
meta.set_status(status)
|
meta.set_status(status)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user