From 8414d44cdf77381e9d66d41fd9ff370fd0fbc28e Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 21 Nov 2024 23:03:05 +0200 Subject: [PATCH] handle empty 61, 62 certificate error messages --- src/app/browser/window/tab/item/page.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index f3f18e81..cadd6c3e 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -870,9 +870,9 @@ impl Page { }, // https://geminiprotocol.net/docs/protocol-specification.gmi#status-60 gemini::client::response::meta::Status::CertificateRequest | - // https://geminiprotocol.net/docs/protocol-specification.gmi#status-61 + // https://geminiprotocol.net/docs/protocol-specification.gmi#status-61-certificate-not-authorized gemini::client::response::meta::Status::CertificateUnauthorized | - // https://geminiprotocol.net/docs/protocol-specification.gmi#status-62 + // https://geminiprotocol.net/docs/protocol-specification.gmi#status-62-certificate-not-valid gemini::client::response::meta::Status::CertificateInvalid => { // Define common data let status = Status::Success; @@ -884,7 +884,11 @@ impl Page { .set_title(title) .set_description(match response.data() { Some(data) => Some(data.value().as_str()), - None => None, + None => match response.status() { + gemini::client::response::meta::Status::CertificateUnauthorized => Some("Certificate not authorized"), + gemini::client::response::meta::Status::CertificateInvalid => Some("Certificate not valid"), + _ => None + }, }); // Update meta