diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index f236f612..79006f5d 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -1289,16 +1289,7 @@ impl App { } let last_response = if let Some(last_success) = last_success { - if matches!(last_success, SingleResponse::Stream(..)) - && !(self.config.free_subscriptions - || web3_request.authorization.active_premium().await) - { - Err(Web3ProxyError::AccessDenied( - "streaming responses require an active premium account".into(), - )) - } else { - Ok(last_success) - } + Ok(last_success) } else { Err(last_error.unwrap_or(anyhow::anyhow!("no success or error").into())) }; @@ -1642,6 +1633,13 @@ impl App { method )).into()); } + // debug methods require premium + if method.starts_with("debug_") && !(self.config.free_subscriptions + || web3_request.authorization.active_premium().await) { + return Err(Web3ProxyError::AccessDenied( + "debug methods require an active premium account".into(), + )); + } if web3_request.cache_mode.is_some() { // don't cache anything larger than 16 MiB