mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Consolidate reqwest versions (#8452)
Update `reqwest` to 0.12 so we only depend on a single version. This should slightly improve compile times and reduce binary bloat. Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -26,7 +26,7 @@ pretty_reqwest_error = { workspace = true }
|
||||
proto_array = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
reqwest = { workspace = true }
|
||||
reqwest-eventsource = "0.5.0"
|
||||
reqwest-eventsource = "0.6.0"
|
||||
sensitive_url = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -5,5 +5,6 @@ pub mod cors;
|
||||
pub mod json;
|
||||
pub mod query;
|
||||
pub mod reject;
|
||||
pub mod status_code;
|
||||
pub mod task;
|
||||
pub mod uor;
|
||||
|
||||
9
common/warp_utils/src/status_code.rs
Normal file
9
common/warp_utils/src/status_code.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use eth2::StatusCode;
|
||||
use warp::Rejection;
|
||||
|
||||
/// Convert from a "new" `http::StatusCode` to a `warp` compatible one.
|
||||
pub fn convert(code: StatusCode) -> Result<warp::http::StatusCode, Rejection> {
|
||||
code.as_u16().try_into().map_err(|e| {
|
||||
crate::reject::custom_server_error(format!("bad status code {code:?} - {e:?}"))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user