Add timestamp header

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-05-27 14:58:57 +01:00
parent cb49e7c9a6
commit 06158cc413

View File

@@ -27,7 +27,8 @@ class SetAPIResponseHeaders extends ThrottleRequests
(int) $response->headers->get('X-RateLimit-Remaining') <= (int) $remainingAttempts) {
$headers = [];
$headers['Retry-After'] = $retryAfter; // this is the only line we changed
$headers['X-RateLimit-Reset'] = $this->availableAt($retryAfter); // this is the only line we changed
$headers['X-RateLimit-Reset'] = $retryAfter; // this is the only line we changed
$headers['X-RateLimit-Reset-Timestamp'] = $this->availableAt($retryAfter); // this is the only line we changed
return $headers;
}
@@ -38,7 +39,8 @@ class SetAPIResponseHeaders extends ThrottleRequests
if (! is_null($retryAfter)) {
$headers['Retry-After'] = $retryAfter;
$headers['X-RateLimit-Reset'] = $this->availableAt($retryAfter);
$headers['X-RateLimit-Reset'] = $retryAfter; // this is the only line we changed
$headers['X-RateLimit-Reset-Timestamp'] = $this->availableAt($retryAfter); // this is the only line we changed
}
return $headers;
@@ -70,7 +72,8 @@ class SetAPIResponseHeaders extends ThrottleRequests
$response,
$limit->maxAttempts,
$this->calculateRemainingAttempts($limit->key, $limit->maxAttempts),
$this->getTimeUntilNextRetry($limit->key) // this is the only line we changed
$this->getTimeUntilNextRetry($limit->key), // this is the only line we changed
$this->getTimeUntilNextRetry($limit->key), // this is the only line we changed
);
}