Skip to content
Snippets Groups Projects
Verified Commit 346ad2a5 authored by Damien's avatar Damien
Browse files

FEAT #7983 Mime type

parent 18fe2705
No related branches found
No related tags found
No related merge requests found
...@@ -182,9 +182,12 @@ class ResController ...@@ -182,9 +182,12 @@ class ResController
return $response->withStatus(404)->withJson(['errors' => 'Document not found on docserver']); return $response->withStatus(404)->withJson(['errors' => 'Document not found on docserver']);
} }
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->buffer($fileContent);
$response->write($fileContent); $response->write($fileContent);
return $response->withHeader('Content-Type', FILEINFO_MIME_TYPE); return $response->withHeader('Content-Type', $mimeType);
} }
public function updateExternalInfos(Request $request, Response $response) public function updateExternalInfos(Request $request, Response $response)
......
...@@ -482,9 +482,12 @@ class UserController ...@@ -482,9 +482,12 @@ class UserController
return $response->withStatus(404)->withJson(['errors' => 'Signature not found on docserver']); return $response->withStatus(404)->withJson(['errors' => 'Signature not found on docserver']);
} }
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->buffer($image);
$response->write($image); $response->write($image);
return $response->withHeader('Content-Type', FILEINFO_MIME_TYPE); return $response->withHeader('Content-Type', $mimeType);
} }
public function addSignature(Request $request, Response $response, array $aArgs) public function addSignature(Request $request, Response $response, array $aArgs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment