streaming responses require premium instead of debug responses
This commit is contained in:
parent
7a019bd1f1
commit
0a4a6d7832
|
@ -1289,7 +1289,16 @@ impl App {
|
||||||
}
|
}
|
||||||
|
|
||||||
let last_response = if let Some(last_success) = last_success {
|
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 {
|
} else {
|
||||||
Err(last_error.unwrap_or(anyhow::anyhow!("no success or error").into()))
|
Err(last_error.unwrap_or(anyhow::anyhow!("no success or error").into()))
|
||||||
};
|
};
|
||||||
|
@ -1633,16 +1642,6 @@ impl App {
|
||||||
method
|
method
|
||||||
)).into());
|
)).into());
|
||||||
}
|
}
|
||||||
if method.starts_with("debug_") {
|
|
||||||
// make sure its premium
|
|
||||||
if !(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() {
|
if web3_request.cache_mode.is_some() {
|
||||||
// don't cache anything larger than 16 MiB
|
// don't cache anything larger than 16 MiB
|
||||||
|
|
Loading…
Reference in New Issue