From 8965009ef47b6284b37a8870b63a68081301f23d Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Wed, 1 May 2024 21:16:27 -0700 Subject: [PATCH 1/2] 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 --- validator_client/src/signing_method.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validator_client/src/signing_method.rs b/validator_client/src/signing_method.rs index fe520e11f5f..08b7a773f7e 100644 --- a/validator_client/src/signing_method.rs +++ b/validator_client/src/signing_method.rs @@ -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::{Client, header::ACCEPT}; 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 From 92f5ad0de49721a5dadf65732c9a1d03f6edd241 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Thu, 2 May 2024 15:53:58 -0700 Subject: [PATCH 2/2] fixup! web3Signer: set header "Accept: application/json" as we expect json in the response --- validator_client/src/signing_method.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator_client/src/signing_method.rs b/validator_client/src/signing_method.rs index 08b7a773f7e..8c11027b8d0 100644 --- a/validator_client/src/signing_method.rs +++ b/validator_client/src/signing_method.rs @@ -7,7 +7,7 @@ use crate::http_metrics::metrics; use eth2_keystore::Keystore; use lockfile::Lockfile; use parking_lot::Mutex; -use reqwest::{Client, header::ACCEPT}; +use reqwest::{header::ACCEPT, Client}; use std::path::PathBuf; use std::sync::Arc; use task_executor::TaskExecutor;