mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-06 23:54:28 +01:00
Fix throttling on PoS
This commit is contained in:
@@ -430,9 +430,9 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
|
||||
}
|
||||
|
||||
private async Task<bool> Throttle(string appId) =>
|
||||
!(await _authorizationService.AuthorizeAsync(HttpContext.User, appId, Policies.CanViewInvoices)).Succeeded &&
|
||||
HttpContext.Connection?.RemoteIpAddress is not null &&
|
||||
!await _rateLimitService.Throttle(ZoneLimits.PublicInvoices, HttpContext.Connection.RemoteIpAddress.ToString(), HttpContext.RequestAborted);
|
||||
HttpContext.Connection is { RemoteIpAddress: { } addr } &&
|
||||
await _rateLimitService.Throttle(ZoneLimits.PublicInvoices, addr.ToString(), HttpContext.RequestAborted) &&
|
||||
!(await _authorizationService.AuthorizeAsync(HttpContext.User, appId, Policies.CanViewInvoices)).Succeeded;
|
||||
|
||||
private JObject TryParseJObject(string posData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user