Return Access-Control-Allow-Origin for all API (content) requests (references #681)

This commit is contained in:
Bernd Bestel 2020-04-22 17:36:20 +02:00
parent 5e6a9dd443
commit 16b9e2c30a
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -18,7 +18,12 @@ class JsonMiddleware extends BaseMiddleware
} }
else else
{ {
return $response->withHeader('Content-Type', 'application/json'); // TODO: This belongs more to CorsMiddleware, but that handles currently OPTIONS (CORS preflight) requests...
$response = $response->withHeader('Access-Control-Allow-Origin', '*');
$response = $response->withHeader('Content-Type', 'application/json');
return $response;
} }
} }
} }