Allow Cache-Control header in emotes API route.

This commit is contained in:
Pachira 2024-11-14 03:02:40 +00:00
parent b4288353f0
commit d38ecf2f90

View file

@ -15,8 +15,12 @@ class V1EmotesRoutes implements RouteHandler {
public function getEmotes($response, $request) {
$response->setHeader('Access-Control-Allow-Origin', '*');
$response->setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
$response->setHeader('Access-Control-Allow-Headers', 'Cache-Control');
$response->setHeader('Cache-Control', 'public, max-age=3600');
if($request->getMethod() === 'OPTIONS')
return 204;
return $this->rpc->query('all', [
'includeId' => !empty($request->getParam('include_id')),
'includeOrder' => !empty($request->getParam('include_order')),