fix: explicitly declare content type im /api/image

This commit is contained in:
b1ek 2024-08-20 19:25:18 +10:00
parent 1839181887
commit 4868f5e016
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 1 additions and 0 deletions

View File

@ -22,6 +22,7 @@ class ApiController extends \yii\rest\Controller
throw new NotFoundHttpException();
}
$response->headers->set('Content-Type', $img->mime);
$response->headers->set('X-Image-Data', json_encode($img->getAttributes()));
return $response->sendFile(env('UPLOADS_PATH') . '/' . $img->sha256, $img->original_name);
}