web3Signer: set header "Accept: application/json" as we expect json in 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
This commit is contained in:
Lukas Rusak
2024-05-05 20:02:47 -07:00
committed by GitHub
parent fe20ef955b
commit da9d38698d

View File

@@ -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;
@@ -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