From 5e291ca70ca2712696fa5378894e4204679a5f7d Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 27 Sep 2021 17:39:43 +0300 Subject: Fix a bug in the error middleware When an error is found, the site name passed to Storage::get_setting in the error handler is incorrect. The ASCII serialisation of the hostname should get used. --- src/frontend/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/frontend/mod.rs') diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index b974a93..37420ac 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -368,7 +368,7 @@ where let site_name = &request .state() .storage - .get_setting("site_name", &request.url().host().unwrap().to_string()) + .get_setting("site_name", &(request.url().origin().ascii_serialization().clone() + "/")) .await .unwrap_or_else(|_| "Kitty Box!".to_string()); let mut res = next.run(request).await; -- cgit 1.4.1