@@ -97,10 +97,10 @@ |
||
| 97 | 97 | foreach($requested->gethHeader('if-match') as $expectedEtag) { |
| 98 | 98 | $expectedEtag = trim($expectedEtag, '"'); |
| 99 | 99 | if($expectedEtag !== $item['etag']){ |
| 100 | - return new Response(412); |
|
| 101 | - } |
|
| 100 | + return new Response(412); |
|
| 101 | + } |
|
| 102 | + } |
|
| 102 | 103 | } |
| 103 | - } |
|
| 104 | 104 | |
| 105 | 105 | $response = (new Response(200))-> |
| 106 | 106 | withBody(stream_for($item['contents']))-> |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $directory = new \RecursiveDirectoryIterator($webroot); |
| 27 | 27 | $directory = new \RecursiveIteratorIterator($directory); |
| 28 | 28 | $directory = iterator_to_array($directory); |
| 29 | - usort($directory, function ($a, $b) { |
|
| 29 | + usort($directory, function($a, $b) { |
|
| 30 | 30 | return $a->getPathname() <=> $b->getPathname(); |
| 31 | 31 | }); |
| 32 | 32 | foreach ($directory as $fileinfo) { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $path = $request->getUri()->getPath(); |
| 82 | 82 | |
| 83 | - return $this->cache->get($path)->then(function ($item) use ($next, $request) { |
|
| 83 | + return $this->cache->get($path)->then(function($item) use ($next, $request) { |
|
| 84 | 84 | if ($item === null) { |
| 85 | 85 | return $next($request); |
| 86 | 86 | } |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | if ($request->hasHeader('If-Match')) { |
| 97 | - foreach($requested->gethHeader('if-match') as $expectedEtag) { |
|
| 97 | + foreach ($requested->gethHeader('if-match') as $expectedEtag) { |
|
| 98 | 98 | $expectedEtag = trim($expectedEtag, '"'); |
| 99 | - if($expectedEtag !== $item['etag']){ |
|
| 99 | + if ($expectedEtag !== $item['etag']) { |
|
| 100 | 100 | return new Response(412); |
| 101 | 101 | } |
| 102 | 102 | } |