Skip to content

Commit

Permalink
Update rate limit headers
Browse files Browse the repository at this point in the history
This updates the following rate limit headers:

* X-RateLimit-Remaining to Rate-Limit-Remaining
* X-RateLimit-Reset to Rate-Limit-Reset
* X-RateLimit-Limit to Rate-Limit-Total
  • Loading branch information
joaonice committed Dec 15, 2016
1 parent 9932747 commit 3c27d65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/Uphold/HttpClient/Message/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class Response extends BaseResponse
public function getApiRateLimit()
{
return array(
'limit' => (string) $this->getHeader('X-RateLimit-Limit'),
'remaining' => (string) $this->getHeader('X-RateLimit-Remaining'),
'reset' => (string) $this->getHeader('X-RateLimit-Reset'),
'limit' => (string) $this->getHeader('Rate-Limit-Total'),
'remaining' => (string) $this->getHeader('Rate-Limit-Remaining'),
'reset' => (string) $this->getHeader('Rate-Limit-Reset'),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ public function shouldThrowApiLimitExceedException()
->expects($this->exactly(3))
->method('getHeader')
->withConsecutive(
array('X-RateLimit-Limit'),
array('X-RateLimit-Remaining'),
array('X-RateLimit-Reset')
array('Rate-Limit-Total'),
array('Rate-Limit-Remaining'),
array('Rate-Limit-Reset')
)
->will($this->onConsecutiveCalls(300, 0, 1384377793))
;
Expand Down
6 changes: 3 additions & 3 deletions test/Uphold/Tests/Unit/HttpClient/Message/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ public function shouldReturnResponseApiRateLimit()
->expects($this->exactly(3))
->method('getHeader')
->withConsecutive(
array('X-RateLimit-Limit'),
array('X-RateLimit-Remaining'),
array('X-RateLimit-Reset')
array('Rate-Limit-Total'),
array('Rate-Limit-Remaining'),
array('Rate-Limit-Reset')
)
->will($this->onConsecutiveCalls($data['limit'], $data['remaining'], $data['reset']))
;
Expand Down

0 comments on commit 3c27d65

Please sign in to comment.