From 492e3bb2ea493cb5d6033fb986f68722fc5eafc0 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 28 Sep 2024 13:07:50 +0300 Subject: [PATCH] draft 31 status code implementation --- src/browser/main/tab/page.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/browser/main/tab/page.rs b/src/browser/main/tab/page.rs index e35a5bd3..e49f1a19 100644 --- a/src/browser/main/tab/page.rs +++ b/src/browser/main/tab/page.rs @@ -242,8 +242,26 @@ impl Page { } None => todo!(), }; - // @TODO }, + // Redirect (@TODO implement limits to auto-redirect) + "31" => { + // Update meta + meta.borrow_mut().mime = Some(Mime::TextGemini); + meta.borrow_mut().title = Some(gformat!("Redirect")); + + // Select widget + match parts.get(3) { + Some(source) => { + let _ = content.reset( + content::Mime::TextGemini, + &uri, + &gformat!("# Redirect\nConfirm:\n=> {source}") + ); + }, + None => todo!(), + } + }, + // @TODO _ => { meta.borrow_mut().title = Some(gformat!("Oops")); meta.borrow_mut().description = Some(gformat!("Status {code} not supported"));