Skip to content

Commit

Permalink
removes direct dependency on hyper in zebra-rpc and uses re-export …
Browse files Browse the repository at this point in the history
…from jsonrpc_http_server instead
  • Loading branch information
arya2 committed Jun 24, 2024
1 parent 38437f1 commit 7cbd15c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5967,7 +5967,6 @@ dependencies = [
"chrono",
"futures",
"hex",
"hyper 1.3.1",
"indexmap 2.2.6",
"insta",
"jsonrpc-core",
Expand Down
3 changes: 0 additions & 3 deletions zebra-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ proptest-impl = [
chrono = { version = "0.4.38", default-features = false, features = ["clock", "std"] }
futures = "0.3.30"

# lightwalletd sends JSON-RPC requests over HTTP 1.1
hyper = { version = "1.3.1", features = ["http1", "server"] }

jsonrpc-core = "18.0.0"
jsonrpc-derive = "18.0.0"
jsonrpc-http-server = "18.0.0"
Expand Down
8 changes: 3 additions & 5 deletions zebra-rpc/src/server/http_request_compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
//! These fixes are applied at the HTTP level, before the RPC request is parsed.
use futures::TryStreamExt;
use hyper::{body::Bytes, Body};

use jsonrpc_http_server::RequestMiddleware;
use jsonrpc_http_server::{RequestMiddleware, hyper};

/// HTTP [`RequestMiddleware`] with compatibility workarounds.
///
Expand Down Expand Up @@ -66,10 +64,10 @@ impl RequestMiddleware for FixHttpRequestMiddleware {
// Fix up the request.
let data = Self::remove_json_1_fields(data);

Bytes::from(data)
hyper::body::Bytes::from(data)
});

Body::wrap_stream(body)
hyper::body::Body::wrap_stream(body)
});

tracing::trace!(?request, "modified HTTP request");
Expand Down

0 comments on commit 7cbd15c

Please sign in to comment.