Merge pull request #505 from sebastian-meyer/add-cors-header-to-file-proxy

Add CORS header to file proxy
This commit is contained in:
Sebastian Meyer 2020-04-24 10:53:23 +02:00 committed by GitHub
commit 8a423becd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -69,6 +69,8 @@ class PageViewProxy
$response = GeneralUtility::makeInstance(Response::class);
if ($fetchedData) {
$response->getBody()->write($fetchedData);
$response = $response->withHeader('Access-Control-Allow-Methods', 'GET');
$response = $response->withHeader('Access-Control-Allow-Origin', $request->getHeader('Origin'));
$response = $response->withHeader('Content-Type', finfo_buffer(finfo_open(FILEINFO_MIME), $fetchedData));
}
if ($header === 0 && !empty($lastModified)) {