Revert "streaming responses require premium instead of debug responses"

This reverts commit 0a4a6d783237af53a3fc4fa4892d891a2357b547.
This commit is contained in:
Bryan Stitt 2023-10-23 17:28:57 -07:00
parent ca52e34762
commit 32935644de

@ -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