diff --git a/Cargo.lock b/Cargo.lock index cf4c88dea..bc83ec975 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1054,7 +1054,6 @@ name = "buzz-db" version = "0.1.0" dependencies = [ "async-trait", - "axum", "buzz-auth", "buzz-core", "buzz-datastore-tracing", @@ -1062,6 +1061,7 @@ dependencies = [ "chrono", "dashmap", "hex", + "http", "metrics", "metrics-util", "nostr 0.44.7", diff --git a/Cargo.toml b/Cargo.toml index c228a754d..4072b9cfa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,7 @@ tokio-util = { version = "0.7", features = ["rt", "codec"] } # HTTP + WebSocket axum = { version = "0.8", features = ["ws", "macros"] } +http = "1" tower = { version = "0.5", features = ["timeout", "util", "limit"] } tower-http = { version = "0.6", features = ["trace", "cors", "compression-gzip", "limit", "timeout", "fs"] } diff --git a/crates/buzz-db/Cargo.toml b/crates/buzz-db/Cargo.toml index 2db6e1d9e..742d96150 100644 --- a/crates/buzz-db/Cargo.toml +++ b/crates/buzz-db/Cargo.toml @@ -12,7 +12,7 @@ buzz-auth = { workspace = true } buzz-core = { workspace = true } buzz-datastore-tracing = { workspace = true } async-trait = "0.1" -axum = { workspace = true } +http = { workspace = true } buzz-media = { workspace = true } dashmap = { workspace = true } sqlx = { workspace = true } diff --git a/crates/buzz-db/src/authorization_restore.rs b/crates/buzz-db/src/authorization_restore.rs index 652847287..64bdcb690 100644 --- a/crates/buzz-db/src/authorization_restore.rs +++ b/crates/buzz-db/src/authorization_restore.rs @@ -656,16 +656,13 @@ impl RestoreStore for S3RestoreStore { if u64::try_from(body.len()).unwrap_or(u64::MAX) > MAX_RECORD_BYTES { return Err(()); } - let mut headers = axum::http::HeaderMap::new(); + let mut headers = http::HeaderMap::new(); match expected_etag { Some(etag) => { - headers.insert(axum::http::header::IF_MATCH, etag.parse().map_err(|_| ())?); + headers.insert(http::header::IF_MATCH, etag.parse().map_err(|_| ())?); } None => { - headers.insert( - axum::http::header::IF_NONE_MATCH, - "*".parse().map_err(|_| ())?, - ); + headers.insert(http::header::IF_NONE_MATCH, "*".parse().map_err(|_| ())?); } } match self