We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 544ed00 commit 676225aCopy full SHA for 676225a
src/Routing/StaticFileManager.php
@@ -326,7 +326,10 @@ private static function serveFile(
326
// Lê e envia conteúdo do arquivo
327
$content = file_get_contents($fileInfo['path']);
328
if ($content === false) {
329
- return $res->status(500)->json(['error' => 'Unable to read file']);
+ return $res
330
+ ->withStatus(500)
331
+ ->withHeader('Content-Type', 'application/json')
332
+ ->withBody(\PivotPHP\Core\Http\Pool\Psr7Pool::getStream(json_encode(['error' => 'Unable to read file'])));
333
}
334
335
// Define o body e retorna response
0 commit comments