-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug: forceHTTPS method ignores baseURL configuration when redirecting #2633
Comments
Right now URI class has no knowledge about a folder in which the application works. I would expect to have this information available via The quick fix would be to use We could also have something like |
The |
I'm not sure how |
Well I haven't actually looked into the code behind this issue at all, so it might not be relevant, but it sounds like you need either a modified version of |
Sadly no. We're working with the URI class here. It's a whole different problem: https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/Common.php#L392 |
It does use
I think we could either ditch using |
Looking a bit more, |
Yes, you're right. That makes a lot of sense. Thanks. |
In the same way as the redirection problem with When calling It seems to me that we have consistent problems with regard to redirects, and it is not just in the case of HTTPS. |
@jlamim I couldn't reproduce the error with |
Sorry, I ended up making a modification to the baseURL in previous tests and forgot to go back to the correct configuration, that's why the error with Thanks @michalsn for reminding me of this detail! |
Describe the bug
When doing a redirect using
$this->forceHTTPS()
, the URL to which the redirection is made does not match the URL of the application.URL accessed:
http://codigos-livroci4.lsd/blog_ci4/public/blog/https
Redirect URL:
https://codigos-livroci4.lsd/blog/https
You should redirect to:
https://codigos-livroci4.lsd/blog_ci4/public/blog/https
baseURL configured:
http://codigos-livroci4.lsd/blog_ci4/public
CodeIgniter 4 version
4.0.2
Affected module(s)
Controller
Expected behavior, and steps to reproduce if appropriate
You should redirect to
https://codigos-livroci4.lsd/blog_ci4/public/blog/https
Context
The text was updated successfully, but these errors were encountered: