From 5ac822d5f984f1b1928d8756cd70843fda3de7b4 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Thu, 11 Apr 2024 13:01:33 -0500 Subject: [PATCH] fix: Middleware order --- actix/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actix/src/main.rs b/actix/src/main.rs index 5dac36f..8291c89 100644 --- a/actix/src/main.rs +++ b/actix/src/main.rs @@ -149,6 +149,8 @@ async fn main() -> Result<()> { // Actually start the server HttpServer::new(move || { App::new() + .wrap(middleware::Logger::default()) + .wrap(middleware::Compress::default()) .wrap( SessionMiddleware::builder(CookieSessionStore::default(), secret_key.clone()) .cookie_same_site(actix_web::cookie::SameSite::Strict) @@ -159,8 +161,6 @@ async fn main() -> Result<()> { .app_data(web::Data::new(AppState { db: database::open_db(env::var("db_url").unwrap_or(db_location.clone())), })) - .wrap(middleware::Logger::default()) - .wrap(middleware::Compress::default()) .service(link_handler) .service(getall) .service(siteurl)