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)

Squashed commit of the following:

commit 92f5ad0
Author: Lukas Rusak <lorusak@gmail.com>
Date:   Thu May 2 15:53:58 2024 -0700

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

commit 8965009
Author: Lukas Rusak <lorusak@gmail.com>
Date:   Wed May 1 21:16:27 2024 -0700

    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>
  • Loading branch information
michaelsproul committed May 3, 2024
1 parent 5ce1671 commit f8b75c5
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 f8b75c5

Please sign in to comment.