- Added a new ArrayCollection
- Changed Action attribute and transformed it into an abstract class
This commit is contained in:
1 parent
0443f5a811
commit
9b360c4010
18 files changed
+311
-86
No files matched your search
+7
-10
@@ -2,23 +2,20 @@
|
||||
|
||||
namespace Lean\Api\Middleware;
|
||||
|
||||
use Laminas\Diactoros\Response\JsonResponse;
|
||||
use Lean\Factory\HttpFactory;
|
||||
use Picea\Ui\Method\FormHandler;
|
||||
use Lean\Api\Lib\RenderCORS;
|
||||
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 {
|
||||
class CORS implements MiddlewareInterface
|
||||
{
|
||||
public function __construct(
|
||||
protected RenderCORS $cors,
|
||||
) {}
|
||||
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
|
||||
{
|
||||
if ($request->getMethod() === "option") {
|
||||
die("an option :)");
|
||||
}
|
||||
|
||||
return $handler->handle($request);
|
||||
return $this->cors->fromResponse($handler->handle($request));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user