Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maslennikov-yv opened this issue Jan 12, 2018 · 1 comment

Comments

@maslennikov-yv
Copy link

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:

$view->addExtension(new Slim\Views\TwigExtension($c->get('router'), $c->get('request')->getUri()));

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

@akrabat
Copy link
Owner

akrabat commented Jan 15, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants