@@ 195-204 (lines=10) @@ | ||
192 | ]); |
|
193 | ||
194 | $response->end(file_get_contents($filePath)); |
|
195 | } else { |
|
196 | if ($this->logger !== null) { |
|
197 | $this->logger->error('HTTP request failed, file unreadable ({filePath})', [ |
|
198 | 'filePath' => $filePath, |
|
199 | ]); |
|
200 | } |
|
201 | ||
202 | $response->writeHead(403, ['Content-Type' => 'text/plain']); |
|
203 | $response->end("Forbidden\n"); |
|
204 | } |
|
205 | } else { |
|
206 | if ($this->logger !== null) { |
|
207 | $this->logger->error('HTTP request failed, file not found ({filePath})', [ |
|
@@ 205-214 (lines=10) @@ | ||
202 | $response->writeHead(403, ['Content-Type' => 'text/plain']); |
|
203 | $response->end("Forbidden\n"); |
|
204 | } |
|
205 | } else { |
|
206 | if ($this->logger !== null) { |
|
207 | $this->logger->error('HTTP request failed, file not found ({filePath})', [ |
|
208 | 'filePath' => $filePath, |
|
209 | ]); |
|
210 | } |
|
211 | ||
212 | $response->writeHead(404, ['Content-Type' => 'text/plain']); |
|
213 | $response->end("Not found\n"); |
|
214 | } |
|
215 | } |
|
216 | ||
217 |