Skip to content

Commit

Permalink
Merge pull request #73 from spira/hotfix/range-header-backup
Browse files Browse the repository at this point in the history
Adding a custom header which can be used as a backup for Range.
  • Loading branch information
Jeremy Sik authored Sep 23, 2016
2 parents 02276be + d399bc0 commit 82fc51c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Responder/Paginator/RangeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ protected function getRequestedRange()
{
if ($this->getRequest()->headers) {
$range = $this->getRequest()->headers->get('Range');
if(!$range) {
$range = $this->getRequest()->headers->get('Range-Requested');
}

if (strpos($range, $this->rangeKey.'=') !== 0) {
throw new HttpException(Response::HTTP_BAD_REQUEST, 'Invalid Range header, Expected format example - `Range: '.$this->rangeKey.'=0-100`');
Expand Down

0 comments on commit 82fc51c

Please sign in to comment.