CorsSlim icon indicating copy to clipboard operation
CorsSlim copied to clipboard

CORS headers not set on exception (SLIM bypasses middleware)

Open patricksavalle opened this issue 8 years ago • 0 comments

The problem is that SLIM bypasses the middleware that sets the CORS headers in some cases. A quick patch would be to change protected function setCorsHeaders($req, $rsp)

Into public function setCorsHeaders($req, $rsp) {

So this function can be called 'manually' from the (custom) 404, 406 and Errorhandlers.

But maybe it is not a big problem at all. Or maybe there is a better solution.

We use: "palanik/corsslim": "dev-slim3"

patricksavalle avatar Apr 11 '16 15:04 patricksavalle