From 98d10cfd5b6ead885b8f888bf5f82fad0c8963ab Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 3 Apr 2023 17:41:52 -0500 Subject: [PATCH] Fixed counting hits --- actix/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actix/src/main.rs b/actix/src/main.rs index 094e7d1..0e03943 100644 --- a/actix/src/main.rs +++ b/actix/src/main.rs @@ -49,9 +49,9 @@ async fn link_handler(shortlink: web::Path) -> impl Responder { let shortlink_str = shortlink.to_string(); let longlink = utils::get_longurl(shortlink_str); if longlink == "".to_string() { - database::add_hit(shortlink.as_str()); Redirect::to("/err/404") } else { + database::add_hit(shortlink.as_str()); Redirect::to(longlink).permanent() } }