register the event to continue the local redirection

This commit is contained in:
yggverse 2025-06-27 08:03:45 +03:00
parent 01a2021fa2
commit 21c8402004

View File

@ -42,16 +42,17 @@ impl Nex {
let path = uri.path(); // copy once let path = uri.path(); // copy once
if path.is_empty() { if path.is_empty() {
// auto-append trailing slash to the root locations
let mut r = uri.to_string(); let mut r = uri.to_string();
r.push('/'); // auto-append trailing slash to the root locations r.push('/');
self.page.navigation.request.info.replace( // apply the permanent redirection
self.page let mut i = self.page.navigation.request.info.take();
.navigation i.add_event("Canonicalize root request".to_string());
.request self.page
.info .navigation
.take() .request
.into_permanent_redirect(), .info
); .replace(i.into_permanent_redirect());
self.page.navigation.set_request(&r); self.page.navigation.set_request(&r);
self.page.item_action.load.activate(Some(&r), false, true); self.page.item_action.load.activate(Some(&r), false, true);
} }