mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-26 23:58:35 -06:00
fix: Middleware order
This commit is contained in:
parent
233247e154
commit
5ac822d5f9
1 changed files with 2 additions and 2 deletions
|
@ -149,6 +149,8 @@ async fn main() -> Result<()> {
|
||||||
// Actually start the server
|
// Actually start the server
|
||||||
HttpServer::new(move || {
|
HttpServer::new(move || {
|
||||||
App::new()
|
App::new()
|
||||||
|
.wrap(middleware::Logger::default())
|
||||||
|
.wrap(middleware::Compress::default())
|
||||||
.wrap(
|
.wrap(
|
||||||
SessionMiddleware::builder(CookieSessionStore::default(), secret_key.clone())
|
SessionMiddleware::builder(CookieSessionStore::default(), secret_key.clone())
|
||||||
.cookie_same_site(actix_web::cookie::SameSite::Strict)
|
.cookie_same_site(actix_web::cookie::SameSite::Strict)
|
||||||
|
@ -159,8 +161,6 @@ async fn main() -> Result<()> {
|
||||||
.app_data(web::Data::new(AppState {
|
.app_data(web::Data::new(AppState {
|
||||||
db: database::open_db(env::var("db_url").unwrap_or(db_location.clone())),
|
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(link_handler)
|
||||||
.service(getall)
|
.service(getall)
|
||||||
.service(siteurl)
|
.service(siteurl)
|
||||||
|
|
Loading…
Reference in a new issue