Allow Cache-Control header in emotes API route.
This commit is contained in:
parent
b4288353f0
commit
d38ecf2f90
1 changed files with 4 additions and 0 deletions
|
@ -15,8 +15,12 @@ class V1EmotesRoutes implements RouteHandler {
|
||||||
public function getEmotes($response, $request) {
|
public function getEmotes($response, $request) {
|
||||||
$response->setHeader('Access-Control-Allow-Origin', '*');
|
$response->setHeader('Access-Control-Allow-Origin', '*');
|
||||||
$response->setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
|
$response->setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
|
||||||
|
$response->setHeader('Access-Control-Allow-Headers', 'Cache-Control');
|
||||||
$response->setHeader('Cache-Control', 'public, max-age=3600');
|
$response->setHeader('Cache-Control', 'public, max-age=3600');
|
||||||
|
|
||||||
|
if($request->getMethod() === 'OPTIONS')
|
||||||
|
return 204;
|
||||||
|
|
||||||
return $this->rpc->query('all', [
|
return $this->rpc->query('all', [
|
||||||
'includeId' => !empty($request->getParam('include_id')),
|
'includeId' => !empty($request->getParam('include_id')),
|
||||||
'includeOrder' => !empty($request->getParam('include_order')),
|
'includeOrder' => !empty($request->getParam('include_order')),
|
||||||
|
|
Loading…
Reference in a new issue