Skip to content

Commit

Permalink
Improvement regex content-range (#136)
Browse files Browse the repository at this point in the history
* Improvement regex content-range

* removed obsolete expression
  • Loading branch information
ho4ho authored and staabm committed Nov 26, 2019
1 parent 73e2fa1 commit bd3958b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function sendResponse(ResponseInterface $response)
// If this is a partial response, flush the beginning bytes until the first position that is a multiple of the page size.
$contentRange = $response->getHeader('Content-Range');
// Matching "Content-Range: bytes 1234-5678/7890"
if (null !== $contentRange && preg_match('/^bytes\s([0-9]*)-([0-9]*)\//i', $contentRange, $matches) && '' !== $matches[1]) {
if (null !== $contentRange && preg_match('/^bytes\s([0-9]+)-([0-9]+)\//i', $contentRange, $matches)) {
// 4kB should be the default page size on most architectures
$pageSize = 4096;
$offset = (int) $matches[1];
Expand Down

0 comments on commit bd3958b

Please sign in to comment.