fix redirection info reset

This commit is contained in:
yggverse 2025-03-27 22:47:38 +02:00
parent 0d202a866a
commit 01ea693c03
12 changed files with 59 additions and 36 deletions

View file

@ -26,7 +26,7 @@ pub fn build(mime: &str, download: Option<(&Rc<ItemAction>, &Uri)>) -> StatusPag
move |_| {
action
.load
.activate(Some(&format!("download:{}", request)), true)
.activate(Some(&format!("download:{}", request)), true, false)
}
});

View file

@ -316,7 +316,7 @@ impl Gemini {
// Select link handler by scheme
return match uri.scheme().as_str() {
"gemini" | "titan" => {
item_action.load.activate(Some(&uri.to_str()), true)
item_action.load.activate(Some(&uri.to_str()), true, false)
}
// Scheme not supported, delegate
_ => UriLauncher::new(&uri.to_str()).launch(

View file

@ -85,6 +85,7 @@ impl Response for Box {
Uri::escape_string(&text_view.text(), None, false),
)),
false,
false,
)
}
});

View file

@ -66,6 +66,7 @@ impl Sensitive for Box {
Uri::escape_string(&form.password_entry_row.text(), None, false),
)),
false,
false,
)
}
});

View file

@ -73,7 +73,10 @@ impl Info {
/// Reset `Self` to the clean state
/// * this method keeps `Redirect` value!
pub fn reset(&mut self) -> &mut Self {
pub fn reset(&mut self, is_unset_redirect: bool) -> &mut Self {
if is_unset_redirect {
self.set_redirect(None);
}
self.clear_events()
.set_header(None)
.set_mime(None)
@ -102,6 +105,11 @@ impl Info {
self
}
pub fn set_redirect(&mut self, redirect: Option<Redirect>) -> &mut Self {
self.redirect = redirect;
self
}
pub fn set_socket(&mut self, address: Option<(SocketAddress, SocketAddress)>) -> &mut Self {
self.socket = address.map(|(local_address, remote_address)| Socket {
local_address,