diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index f2034021..93d179b3 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -56,6 +56,10 @@ class OnRequest extends Callback /** @var HRequest $sRequest */ [$sRequest, $sResponse] = [HRequest::create($request), HResponse::create($response)]; + $sResponse->addHeader('Access-Control-Allow-Origin', '*'); + $sResponse->addHeader('Access-Control-Allow-Headers', $sRequest->headers->get('access-control-request-headers')); + $sResponse->addHeader('Access-Control-Request-Method', $sRequest->headers->get('access-control-request-method')); + if ($sRequest->is('favicon.ico')) { return $sResponse->send($sRequest->isNotFound(), 200); }