cors-middleware
cors-middleware copied to clipboard
PSR-7 and PSR-15 CORS middleware
## Scenario 1. User agent sends preflight request with requested methods and headers. 2. One of the **headers** fails the check, but the origin is correct, the methods are correct...
I've trouble dynamically specifying the allowed methods while using Slim4 like you did in the readme file for Slim3 ```php use Fastroute\Dispatcher; use Tuupola\Middleware\CorsMiddleware; $app->add( new CorsMiddleware([ "origin" => ["*"],...
Whenever an exception is thrown by any of my classes, response loses cors headers. Setting CORS headers manualy within the slim 'errorHandler', solves the issue, but does not feel right.
Version 2 is out https://github.com/neomerx/cors-psr7/tree/v2.0.2. I can see you're already ahead on this: https://github.com/neomerx/cors-psr7/issues/32. Just wanted to give you the heads up.
## Observed I got the following error: ``` ERROR: Undefined index: host on line 214 in file [...]/vendor/tuupola/cors-middleware/src/CorsMiddleware.php. ``` ## Fix Change the setting `'origin.server' => 'localhost'` to `'origin.server' =>...
Question, How to use this with PHP-DI for example? `return [ 'middlewares' => [ autowire(ErrorHandlingMiddleware::class), autowire(ClaimMiddleware::class) ]` I tried but i'm not able to set the options like this way
I would like to use this package with `psr/http-message` v 2.x. I could easily provide PR with update to `composer.json` to allow it, but there is a problem with `neomerx/cors-psr7`...
With the new PHP 8.4 version comes "Implicitly nullable parameter declarations deprecated" which causes alot of warnings. Is it possible to fix the deprecated warnings? Example: Deprecated: Tuupola\Middleware\CorsMiddleware::logger(): Implicitly marking...