From 008de23403f20be100dc405a6b94d95c48a851fc Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Tue, 21 Oct 2025 18:17:43 -0700 Subject: [PATCH] Follow changes to http-handler and http-rewriter --- Cargo.lock | 41 +++++++++++++++++++++++++---------------- Cargo.toml | 2 ++ src/lib.rs | 9 +++------ 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71e7117..82830bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,9 +99,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "bytes" @@ -117,9 +117,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "clap" -version = "4.5.49" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4512b90fa68d3a9932cea5184017c5d200f5921df706d45e853537dea51508f" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" dependencies = [ "clap_builder", "clap_derive", @@ -127,9 +127,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.49" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0025e98baa12e766c67ba13ff4695a887a1eba19569aad00a472546795bd6730" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" dependencies = [ "anstream", "anstyle", @@ -380,7 +380,7 @@ dependencies = [ [[package]] name = "http-handler" version = "1.0.0" -source = "git+https://github.com/platformatic/http-handler#3899d3ed32afb3830b650fbf468f0a84231bbd27" +source = "git+https://github.com/platformatic/http-handler#f60dbc830e12b1cedae4c8a4f370bc4133a868fc" dependencies = [ "async-trait", "bytes", @@ -393,7 +393,7 @@ dependencies = [ [[package]] name = "http-rewriter" version = "1.0.0" -source = "git+https://github.com/platformatic/http-rewriter#d31cd99f759bf15fa4d441e31b920bcc09c2ac2d" +source = "git+https://github.com/platformatic/http-rewriter#2c2319e6721f20a0eebcb37904d15aa411cc668f" dependencies = [ "bytes", "http", @@ -416,15 +416,18 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.6" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" @@ -584,9 +587,9 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "parking_lot" @@ -789,6 +792,12 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + [[package]] name = "ruzstd" version = "0.7.3" @@ -956,9 +965,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" [[package]] name = "unicode-segmentation" diff --git a/Cargo.toml b/Cargo.toml index d1ba268..c17217a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,9 @@ crate-type = ["cdylib"] async-trait = "0.1.88" bytes = "1.10.1" http-handler = { git = "https://github.com/platformatic/http-handler" } +# http-handler = { path = "../http-handler" } http-rewriter = { git = "https://github.com/platformatic/http-rewriter" } +# http-rewriter = { path = "../http-rewriter" } # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix napi = { version = "3", default-features = false, features = ["napi4", "tokio_rt", "async"], optional = true } napi-derive = { version = "3", optional = true } diff --git a/src/lib.rs b/src/lib.rs index 2dea575..f6830a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,10 +233,9 @@ impl PythonHandler { /// ``` #[napi] pub async fn handle_request(&self, request: &NapiRequest) -> Result { - use std::ops::Deref; let response = self .asgi - .handle(request.deref().clone()) + .handle(request.clone().into_inner()) .await .map_err(|e| Error::from_reason(e.to_string()))?; Ok(response.into()) @@ -246,11 +245,10 @@ impl PythonHandler { // request: &NapiRequest, // signal: Option, // ) -> AsyncTask { - // use std::ops::Deref; // AsyncTask::with_optional_signal( // PythonRequestTask { // asgi: self.asgi.clone(), - // request: request.deref().clone(), + // request: request.clone().into_inner(), // }, // signal, // ) @@ -276,10 +274,9 @@ impl PythonHandler { /// ``` #[napi] pub fn handle_request_sync(&self, request: &NapiRequest) -> Result { - use std::ops::Deref; let mut task = PythonRequestTask { asgi: self.asgi.clone(), - request: request.deref().clone(), + request: request.clone().into_inner(), }; task.compute().map(Into::::into)