feat : cors

This commit is contained in:
2024-11-07 09:47:06 +08:00
parent c022fa9152
commit 3a74ba535b

View File

@@ -21,6 +21,8 @@ class CorsMiddleware implements MiddlewareInterface
->withHeader('Access-Control-Allow-Methods', '*') ->withHeader('Access-Control-Allow-Methods', '*')
->withHeader('Access-Control-Max-Age', 1800); ->withHeader('Access-Control-Max-Age', 1800);
Context::set(ResponseInterface::class, $response);
if ($request->getMethod() == 'OPTIONS') { if ($request->getMethod() == 'OPTIONS') {
return $response; return $response;
} }