Skip to content

Commit

Permalink
web3Signer: set header "Accept: application/json" as we expect json i…
Browse files Browse the repository at this point in the history
…n the response (#5692)

* web3Signer: set header "Accept: application/json" as we expect json in the response

The web3signer handler in lighthouse requires a json response.
Setting the header "Accept: application/json" indicates to the web3signer that json is an acceptable response.

Signed-off-by: Lukas Rusak <lorusak@gmail.com>

* fixup! web3Signer: set header "Accept: application/json" as we expect json in the response
  • Loading branch information
lrusak authored May 6, 2024
1 parent fe20ef9 commit da9d386
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion validator_client/src/signing_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::http_metrics::metrics;
use eth2_keystore::Keystore;
use lockfile::Lockfile;
use parking_lot::Mutex;
use reqwest::Client;
use reqwest::{header::ACCEPT, Client};
use std::path::PathBuf;
use std::sync::Arc;
use task_executor::TaskExecutor;
Expand Down Expand Up @@ -243,6 +243,7 @@ impl SigningMethod {
// Request a signature from the Web3Signer instance via HTTP(S).
let response: SigningResponse = http_client
.post(signing_url.clone())
.header(ACCEPT, "application/json")
.json(&request)
.send()
.await
Expand Down

0 comments on commit da9d386

Please sign in to comment.