From dce5dae5b4f5807a964dbc624a4994c59ad32dbc Mon Sep 17 00:00:00 2001 From: Jkorf Date: Fri, 20 Feb 2026 15:57:34 +0100 Subject: [PATCH] wip --- CryptoExchange.Net/RateLimiting/Filters/PathStartFilter.cs | 2 +- .../SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CryptoExchange.Net/RateLimiting/Filters/PathStartFilter.cs b/CryptoExchange.Net/RateLimiting/Filters/PathStartFilter.cs index ba68b8b..721d9d2 100644 --- a/CryptoExchange.Net/RateLimiting/Filters/PathStartFilter.cs +++ b/CryptoExchange.Net/RateLimiting/Filters/PathStartFilter.cs @@ -22,6 +22,6 @@ namespace CryptoExchange.Net.RateLimiting.Filters /// public bool Passes(RateLimitItemType type, RequestDefinition definition, string host, string? apiKey) - => definition.Path.StartsWith(_path, StringComparison.OrdinalIgnoreCase); + => definition.Path.TrimStart('/').StartsWith(_path, StringComparison.OrdinalIgnoreCase); } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs index 766ab95..4f4e8ac 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs @@ -80,7 +80,7 @@ namespace CryptoExchange.Net.SharedApis { // When going descending we can still allow startTime filter to limit the results var now = DateTime.UtcNow; - if ((request.Direction != DataDirection.Descending && request.StartTime != null) + if ((request.Direction == DataDirection.Ascending && request.StartTime != null) || (request.EndTime != null && now - request.EndTime > TimeSpan.FromSeconds(5))) { return ArgumentError.Invalid(nameof(GetDepositsRequest.StartTime), $"Time filter is not supported");