private static void addRemainingHeader(IHttpResponse response, ThrottlingConfiguration configuration, RequestCount count) { string numberOfRequestLeftInPeriod = count != null? count.Remaining(configuration.NumberOfRequests).ToString(CultureInfo.InvariantCulture) : configuration.FormattedRequests; response.AddHeader("X-Rate-Limit-Remaining", numberOfRequestLeftInPeriod); }
private static void addResetHeader(IHttpResponse response, ThrottlingConfiguration configuration, RequestCount count) { string numberOfSecondsLeftInPeriod = count != null? count.Remaining(DateTimeOffset.UtcNow).ToString(CultureInfo.InvariantCulture) : configuration.FormattedSeconds; response.AddHeader("X-Rate-Limit-Reset", numberOfSecondsLeftInPeriod); }