From 939b14403f909fa2e9010efad39b69250cbdab05 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Fri, 1 Mar 2024 14:35:03 -0500 Subject: [PATCH] Add tower-http crate --- Cargo.lock | 32 ++++++++++++++++++++++++++++++++ Cargo.toml | 2 ++ 2 files changed, 34 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index f203a21..16c80c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1341,6 +1341,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + [[package]] name = "httparse" version = "1.8.0" @@ -1854,6 +1860,7 @@ dependencies = [ "time", "tokio", "tower", + "tower-http", "wasm-bindgen", ] @@ -3097,6 +3104,31 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "bitflags 2.4.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-layer" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index 0fc35b4..2ae6cc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ futures = { version = "0.3.30", default-features = false, optional = true } tokio = { version = "1", optional = true } axum = { version = "0.6.4", optional = true } tower = { veresion = "0.4.13", optional = true } +tower-http = { version = "0.4", optional = true, features = ["fs"] } [features] csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"] @@ -68,6 +69,7 @@ ssr = [ "tokio", "axum", "tower", + "tower-http", ] # Defines a size-optimized profile for the WASM bundle in release mode