Workaround for #10

This commit is contained in:
Lennart
2025-01-04 16:10:07 +01:00
parent f406b7dbb2
commit 577091cf02
5 changed files with 6 additions and 28 deletions

21
Cargo.lock generated
View File

@@ -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]]

View File

@@ -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

View File

@@ -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()
}
}

View File

@@ -48,5 +48,5 @@ pub fn make_app<AS: AddressbookStore + ?Sized, CS: CalendarStore + ?Sized>(
frontend_config,
)
}))
.service(web::redirect("/", "/frontend").see_other())
// .service(web::redirect("/", "/frontend").see_other())
}

View File

@@ -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?;
}