From b5de925d8f3868502cc1813ab66d565b7865aedb Mon Sep 17 00:00:00 2001 From: chonghe <44791194+chong-he@users.noreply.github.com> Date: Mon, 20 May 2024 10:17:43 +0800 Subject: [PATCH] Use JSON header by default for `/eth/v1/beacon/deposit_snapshot` (#5813) * Fix with or * Flip case --- beacon_node/http_api/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 024e268e2a..1d7095ae13 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -2121,14 +2121,7 @@ pub fn serve( task_spawner: TaskSpawner, eth1_service: eth1::Service| { task_spawner.blocking_response_task(Priority::P1, move || match accept_header { - Some(api_types::Accept::Json) | None => { - let snapshot = eth1_service.get_deposit_snapshot(); - Ok( - warp::reply::json(&api_types::GenericResponse::from(snapshot)) - .into_response(), - ) - } - _ => eth1_service + Some(api_types::Accept::Ssz) => eth1_service .get_deposit_snapshot() .map(|snapshot| { Response::builder() @@ -2154,6 +2147,13 @@ pub fn serve( )) }) }), + _ => { + let snapshot = eth1_service.get_deposit_snapshot(); + Ok( + warp::reply::json(&api_types::GenericResponse::from(snapshot)) + .into_response(), + ) + } }) }, );