27 lines
737 B
PHP
27 lines
737 B
PHP
<?php
|
|
|
|
namespace Lean\Api\Middleware;
|
|
|
|
use Laminas\Diactoros\Response\JsonResponse;
|
|
use Lean\Factory\HttpFactory;
|
|
use Picea\Ui\Method\FormHandler;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Psr\Http\Server\MiddlewareInterface;
|
|
use Psr\Http\Server\RequestHandlerInterface;
|
|
use Lean\Api\{Factory\DebugFormFactoryInterface, Form, Entity};
|
|
|
|
class CORS implements MiddlewareInterface {
|
|
|
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
|
|
{
|
|
|
|
var_dump($request->getMethod() );
|
|
if ($request->getMethod() === "option") {
|
|
die("an option :)");
|
|
}
|
|
|
|
return $handler->handle($request);
|
|
}
|
|
}
|