mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 19:16:37 +00:00
Return Access-Control-Allow-Origin for all API (content) requests (references #681)
This commit is contained in:
@@ -18,7 +18,12 @@ class JsonMiddleware extends BaseMiddleware
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user