Skip to content

Commit 7dd0126

Browse files
authored
Follow changes to http-handler and http-rewriter (#32)
1 parent fbcaa94 commit 7dd0126

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

Cargo.lock

Lines changed: 25 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ crate-type = ["cdylib"]
2525
async-trait = "0.1.88"
2626
bytes = "1.10.1"
2727
http-handler = { git = "https://github.com/platformatic/http-handler" }
28+
# http-handler = { path = "../http-handler" }
2829
http-rewriter = { git = "https://github.com/platformatic/http-rewriter" }
30+
# http-rewriter = { path = "../http-rewriter" }
2931
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
3032
napi = { version = "3", default-features = false, features = ["napi4", "tokio_rt", "async"], optional = true }
3133
napi-derive = { version = "3", optional = true }

src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,9 @@ impl PythonHandler {
233233
/// ```
234234
#[napi]
235235
pub async fn handle_request(&self, request: &NapiRequest) -> Result<NapiResponse> {
236-
use std::ops::Deref;
237236
let response = self
238237
.asgi
239-
.handle(request.deref().clone())
238+
.handle(request.clone().into_inner())
240239
.await
241240
.map_err(|e| Error::from_reason(e.to_string()))?;
242241
Ok(response.into())
@@ -246,11 +245,10 @@ impl PythonHandler {
246245
// request: &NapiRequest,
247246
// signal: Option<AbortSignal>,
248247
// ) -> AsyncTask<PythonRequestTask> {
249-
// use std::ops::Deref;
250248
// AsyncTask::with_optional_signal(
251249
// PythonRequestTask {
252250
// asgi: self.asgi.clone(),
253-
// request: request.deref().clone(),
251+
// request: request.clone().into_inner(),
254252
// },
255253
// signal,
256254
// )
@@ -276,10 +274,9 @@ impl PythonHandler {
276274
/// ```
277275
#[napi]
278276
pub fn handle_request_sync(&self, request: &NapiRequest) -> Result<NapiResponse> {
279-
use std::ops::Deref;
280277
let mut task = PythonRequestTask {
281278
asgi: self.asgi.clone(),
282-
request: request.deref().clone(),
279+
request: request.clone().into_inner(),
283280
};
284281

285282
task.compute().map(Into::<NapiResponse>::into)

0 commit comments

Comments
 (0)