From d38ecf2f90ede6f352946d0c4157b088670fffdc Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 14 Nov 2024 03:02:40 +0000 Subject: [PATCH] Allow Cache-Control header in emotes API route. --- src/V1/V1EmotesRoutes.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/V1/V1EmotesRoutes.php b/src/V1/V1EmotesRoutes.php index fdd7729..8b69dda 100644 --- a/src/V1/V1EmotesRoutes.php +++ b/src/V1/V1EmotesRoutes.php @@ -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')),