1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 20:28:21 +01:00

response sends correct mime info

This commit is contained in:
Oliver Vogel 2014-05-12 16:12:06 +02:00
parent 7d8bdd61d1
commit 40d9265123

View File

@ -17,16 +17,18 @@ class Response
public function make()
{
$data = $this->image->encode($this->format, $this->quality);
$this->image->encode($this->format, $this->quality);
$data = $this->image->getEncoded();
$mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $data);
if (function_exists('app') && is_a($app = app(), 'Illuminate\Foundation\Application')) {
$response = \Response::make($data);
$response->header('Content-Type', $this->image->mime);
$response->header('Content-Type', $mime);
} else {
header('Content-Type: ' . $this->image->mime);
header('Content-Type: ' . $mime);
$response = $data;
}