From 4694683b9a382ff45c49abe744c467d5ac57e116 Mon Sep 17 00:00:00 2001 From: Ninja3047 Date: Sun, 10 Jul 2022 23:31:54 -0400 Subject: [PATCH] update axum --- server/Cargo.toml | 34 +++++++++++++++++----------------- server/src/main.rs | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/server/Cargo.toml b/server/Cargo.toml index 5c9a830..7c6aa3d 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -7,24 +7,24 @@ edition = "2021" [dependencies] omegaupload-common = { path = "../common" } -anyhow = "1" -axum = { version = "0.4", features = ["http2", "headers"] } -bincode = "1" +anyhow = "1.0.58" +axum = { version = "0.5.11", features = ["http2", "headers"] } +bincode = "1.3.3" # We don't care about which version (We want to match with axum), we just need # to enable the feature -bytes = { version = "*", features = ["serde"] } -chrono = { version = "0.4", features = ["serde"] } -futures = "0.3" +bytes = { version = "1.1.0", features = ["serde"] } +chrono = { version = "0.4.19", features = ["serde"] } +futures = "0.3.21" # We just need to pull in whatever axum is pulling in -headers = "*" -lazy_static = "1" +headers = "0.3.7" +lazy_static = "1.4.0" # Disable `random()` and `thread_rng()` -rand = { version = "0.8", default_features = false } -rocksdb = { version = "0.18", default_features = false, features = ["zstd"] } -serde = { version = "1", features = ["derive"] } -signal-hook = "0.3" -signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } -tower-http = { version = "0.2", features = ["fs"] } -tracing = { version = "0.1" } -tracing-subscriber = "0.3" \ No newline at end of file +rand = { version = "0.8.5", default_features = false } +rocksdb = { version = "0.18.0", default_features = false, features = ["zstd"] } +serde = { version = "1.0.138", features = ["derive"] } +signal-hook = "0.3.14" +signal-hook-tokio = { version = "0.3.1", features = ["futures-v0_3"] } +tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread"] } +tower-http = { version = "0.3.4", features = ["fs"] } +tracing = "0.1.35" +tracing-subscriber = "0.3.14" diff --git a/server/src/main.rs b/server/src/main.rs index 5674adf..b5840e9 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -27,7 +27,7 @@ use axum::extract::{Extension, Path, TypedHeader}; use axum::http::header::EXPIRES; use axum::http::StatusCode; use axum::routing::{get, get_service, post}; -use axum::{AddExtensionLayer, Router}; +use axum::Router; use chrono::Utc; use futures::stream::StreamExt; use headers::HeaderMap; @@ -103,7 +103,7 @@ async fn main() -> Result<()> { &format!("{API_ENDPOINT}/:code"), get(paste::).delete(delete::), ) - .layer(AddExtensionLayer::new(db)) + .layer(axum::Extension(db)) .into_make_service() }) .await?;