diff --git a/Cargo.lock b/Cargo.lock index d7577da..8917a21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,8 +519,6 @@ dependencies = [ "http 1.2.0", "http-body", "http-body-util", - "hyper", - "hyper-util", "itoa", "matchit", "memchr", @@ -529,15 +527,10 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", "sync_wrapper", - "tokio", "tower 0.5.2", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -558,7 +551,6 @@ dependencies = [ "sync_wrapper", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -2597,7 +2589,6 @@ dependencies = [ "anyhow", "argon2", "async-trait", - "axum", "clap", "opentelemetry", "opentelemetry-otlp", @@ -2839,16 +2830,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - [[package]] name = "serde_spanned" version = "0.6.8" @@ -3550,10 +3531,8 @@ dependencies = [ "futures-util", "pin-project-lite", "sync_wrapper", - "tokio", "tower-layer", "tower-service", - "tracing", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6daa4ba..df29692 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,6 @@ quote = "1.0" proc-macro2 = "1.0" heck = "0.5" darling = "0.20" -axum = { version = "0.7", features = ["http2"] } [dependencies] rustical_store = { workspace = true } @@ -133,4 +132,3 @@ rpassword.workspace = true argon2.workspace = true pbkdf2.workspace = true password-hash.workspace = true -axum.workspace = true diff --git a/crates/store/src/auth/user.rs b/crates/store/src/auth/user.rs index 6822ea2..aa741fe 100644 --- a/crates/store/src/auth/user.rs +++ b/crates/store/src/auth/user.rs @@ -27,10 +27,6 @@ impl ResponseError for UnauthorizedError { header::WWW_AUTHENTICATE, r#"Basic realm="RustiCal", charset="UTF-8""#, )) - // The force_close is a workaround for a bug where something freezes when the - // connection is reused after a 401. - // possibly related to https://github.com/actix/actix-web/issues/1805 - .force_close() .finish() } } diff --git a/src/app.rs b/src/app.rs index ce14db2..1215b4d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -48,5 +48,5 @@ pub fn make_app( frontend_config, ) })) - .service(web::redirect("/", "/frontend").see_other()) + // .service(web::redirect("/", "/frontend").see_other()) } diff --git a/src/main.rs b/src/main.rs index 811a04f..e0a2372 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use crate::config::Config; +use actix_web::http::KeepAlive; use actix_web::HttpServer; use anyhow::Result; use app::make_app; @@ -75,6 +76,10 @@ async fn main() -> Result<()> { ) }) .bind((config.http.host, config.http.port))? + // Workaround for a weird bug where + // new requests might timeout since they cannot properly reuse the connection + // https://github.com/lennart-k/rustical/issues/10 + .keep_alive(KeepAlive::Disabled) .run() .await?; }