Forgot to register the OPTIONS method :3

This commit is contained in:
flash 2024-11-14 03:19:47 +00:00
parent d38ecf2f90
commit fd24b59e89

View file

@ -1,7 +1,7 @@
<?php <?php
namespace Syokuhou\V1; namespace Syokuhou\V1;
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait}; use Index\Http\Routing\{HttpGet,HttpOptions,RouteHandler,RouteHandlerTrait};
use RPCii\Client\RpcClient; use RPCii\Client\RpcClient;
class V1EmotesRoutes implements RouteHandler { class V1EmotesRoutes implements RouteHandler {
@ -11,6 +11,7 @@ class V1EmotesRoutes implements RouteHandler {
private RpcClient $rpc private RpcClient $rpc
) {} ) {}
#[HttpOptions('/')]
#[HttpGet('/')] #[HttpGet('/')]
public function getEmotes($response, $request) { public function getEmotes($response, $request) {
$response->setHeader('Access-Control-Allow-Origin', '*'); $response->setHeader('Access-Control-Allow-Origin', '*');