Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 0 |
1 | <?php |
||
56 | private function transfer304(ResourceObject $ro) |
||
57 | { |
||
58 | $allowedHeaderIn304 = [ |
||
59 | 'Cache-Control', |
||
60 | 'Content-Location', |
||
61 | 'Date', |
||
62 | 'ETag', |
||
63 | 1 | 'Expires', |
|
64 | 1 | 'Vary', |
|
65 | ]; |
||
66 | |||
67 | // header |
||
68 | 1 | foreach ($ro->headers as $label => $value) { |
|
69 | if (! in_array($label, $allowedHeaderIn304, true)) { |
||
70 | continue; |
||
71 | } |
||
72 | 1 | ||
73 | 1 | header("{$label}: {$value}", false); |
|
74 | } |
||
75 | |||
76 | // code |
||
77 | http_response_code(304); |
||
78 | } |
||
80 |