From 63c4f9e591228f33e3980c436e6b7e819a6c43a9 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 21 Jun 2023 11:28:22 -0700 Subject: [PATCH] allow no ip this shouldn't be needed, but is a workaround while we debug staging --- web3_proxy/src/frontend/users/payment.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/frontend/users/payment.rs b/web3_proxy/src/frontend/users/payment.rs index 481bb14c..2614132a 100644 --- a/web3_proxy/src/frontend/users/payment.rs +++ b/web3_proxy/src/frontend/users/payment.rs @@ -105,7 +105,7 @@ pub async fn user_deposits_get( #[debug_handler] pub async fn user_balance_post( Extension(app): Extension>, - InsecureClientIp(ip): InsecureClientIp, + ip: Option, Path(mut params): Path>, bearer: Option>>, ) -> Web3ProxyResponse { @@ -117,10 +117,12 @@ pub async fn user_balance_post( let authorization = Web3ProxyAuthorization::internal(app.db_conn())?; (authorization, Some(semaphore)) - } else { + } else if let Some(InsecureClientIp(ip)) = ip { let authorization = login_is_authorized(&app, ip).await?; (authorization, None) + } else { + return Err(Web3ProxyError::AccessDenied); }; // Get the transaction hash