-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.4] Fix cache in mix method. #19968
Conversation
We need a clear explanation of what is wrong with it. Someone disagreed that it was broken in that thread. |
As I said in #19764 (comment): If you look at the code, you will directly see that this can't work. The mix method will continue to work globally, but it will no longer have a cache system. We could stop wasting time with this kind of discussion if things were tested (like in the PR you closed...). |
Adding asset() here broke our app by adding full URLs instead of relative. URLs were not secure causing the browser to not load them. |
Hi @VinnyWeb1 , I'm sorry about that I didn't think about this.. weird case. Do you know why your assets urls are not secure?
The check for secure url is done here. You can quickly fix that using the |
Hey @mathieutu , I'm not exactly sure why they aren't HTTPS, it may be one of our configurations we have set. But when we develop locally, we don't use HTTPS, our beta servers and production servers both have SSLs installed. We've always tried to use relative URLs instead absolute url due to a similar issue to this. But since v5.4.29, our stylesheets and javascript failed to load, so i temporarily reverted back to v5.4.28. I guess i can do some sort of environment check and force HTTPS with that function you provided. But i'm not sure why, but asset() and route() both return HTTP URLs. Edit: I'm thinking it may be because we're using AWS Elastic Beanstalk and the SSL is on the Load Balancer. So Laravel might not know about the certificate? |
Yeah we all have the same pattern (http in local, https in prod) |
I went ahead and tested it as well and it is working on local, beta, and production. Thanks @mathieutu |
I've made a PR that reverts the addition of the As far as Laravel not realising it's a HTTPS connection behind a load balancer like on Elastic Beanstalk, you probably need to use the TrustedProxies package which you can use to instruct Laravel that it is in fact a secure connection, despite the fact it's handed off as a standard HTTP request. |
Fix #19764.