eee
This commit is contained in:
@@ -26,15 +26,15 @@ class CoreMiddleware implements MiddlewareInterface
|
|||||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||||
{
|
{
|
||||||
$response = \Kiri::getDi()->get(ResponseInterface::class);
|
$response = \Kiri::getDi()->get(ResponseInterface::class);
|
||||||
if ($request->getMethod() == 'OPTIONS') {
|
|
||||||
return $response->withStatus(200)->withBody(new Stream(''));
|
|
||||||
}
|
|
||||||
var_dump($request->getHeaders());
|
|
||||||
$response->withHeaders([
|
$response->withHeaders([
|
||||||
'Access-Control-Allow-Headers' => $request->getHeaderLine('Access-Control-Allow-Headers'),
|
'Access-Control-Allow-Headers' => $request->getHeaderLine('Access-Control-Allow-Headers'),
|
||||||
'Access-Control-Request-Method' => $request->getHeaderLine('Access-Control-Request-Method'),
|
'Access-Control-Request-Method' => $request->getHeaderLine('Access-Control-Request-Method'),
|
||||||
'Access-Control-Allow-Origin' => $request->getHeaderLine('Access-Control-Allow-Origin')
|
'Access-Control-Allow-Origin' => $request->getHeaderLine('Access-Control-Allow-Origin')
|
||||||
]);
|
]);
|
||||||
|
if ($request->getMethod() == 'OPTIONS') {
|
||||||
|
return $response->withStatus(200)->withBody(new Stream(''));
|
||||||
|
}
|
||||||
|
var_dump($request->getHeaders());
|
||||||
return $handler->handle($request);
|
return $handler->handle($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user