Skip to content

Commit

Permalink
Merge pull request #145 from seegno/support/rate-limit-headers
Browse files Browse the repository at this point in the history
Update rate limit headers
  • Loading branch information
nunorafaelrocha authored Dec 15, 2016
2 parents 9932747 + 3c27d65 commit a46fca2
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 a46fca2

Please sign in to comment.