A free open source IT asset/license management system
Add timestamp header
snipe06158cc41329
diff --git a/app/Http/Middleware/SetAPIResponseHeaders.php b/app/Http/Middleware/SetAPIResponseHeaders.phpindex c39565071a..4c4938c8ff 100644--- a/app/Http/Middleware/SetAPIResponseHeaders.php+++ b/app/Http/Middleware/SetAPIResponseHeaders.php@@ -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 changedreturn $headers;}@@ -38,7 +39,8 @@ class SetAPIResponseHeaders extends ThrottleRequestsif (! 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);}