akrabat / slim3-skeleton

Simple Slim Framework 3 skeleton with Twig & Monolog
BSD 3-Clause "New" or "Revised" License
344 stars 99 forks source link

Middleware https://github.com/akrabat/rka-scheme-and-host-detection-middleware not affected #41

Open maslennikov-yv opened 6 years ago

maslennikov-yv commented 6 years ago

I try to use https://github.com/akrabat/rka-scheme-and-host-detection-middleware to prevent "Mixed content" error. After set X-Forwarded-Proto:https header in controller everything ok: $request->getUri()->getScheme(); return "https".

But here it's not working: https://github.com/akrabat/slim3-skeleton/blob/a39939d473ec84801f4c66a5fa3677e7edb1da58/app/dependencies.php#L16

$c->get('request')->getUri()->getScheme(); return "http" :(

akrabat commented 6 years ago

Yeah,

Using the request from the container won't work as it's the wrong one.

I think you need to not add the extension when registering the view, but rather do it in middleware after the host-detection-middleware has executed.