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

trusted proxies gets overwritten #48

Open
justijndepover opened this issue Jul 2, 2021 · 7 comments
Open

trusted proxies gets overwritten #48

justijndepover opened this issue Jul 2, 2021 · 7 comments

Comments

@justijndepover
Copy link

Hi

I have a case where the trusted proxies should allow all ($proxies = '*';).
It seems that the package overwrites the config that's been set in the TrustProxies middleware.

My solution now is to overwrite the config again in the AppServiceProvider. Is this the preferred way?

Shouldn't it be better to provide a config/serverless.php configuration file, and make that behaviour configurable?

@deleugpn
Copy link
Member

deleugpn commented Jul 3, 2021

The package automatically allows 0.0.0.0/0 which essentially would be the same as *, no?
Can you help me understand a use case that works with * only?

@justijndepover
Copy link
Author

I'm relatively new to serverless so I'm not sure if I can provide much details.

In my case I have to overwrite the setting again or else my redirects, generated urls, asset urls, ... are all generated with the wrong domain.

@buddhaCode
Copy link

In a brand new Laravel 8 installation, this package doesn't overwrite the trusted proxies configuration. The config @deleugpn mentioned only overrides the trusted proxy config, when the fideloper/TrustedProxy is used. I guess this package was used prior to Laravel 5.something.

@t-richard
Copy link
Member

t-richard commented Feb 4, 2022

Someone faced this issue again today (see brefphp/bref#1159)

I backtraced the issue to this PR in laravel laravel/framework#38295

Since laravel 8, they backported the Trustproxies middleware inside Laravel itself but dropped the possibility to configure it through config

In contrary to the original package, all configuration is done through overwriting properties

Not sure what is the proper Laravel way to handle this. Maybe we should just update the Bref documentation as it's done for Symfony ATM https://bref.sh/docs/frameworks/symfony.html#trust-api-gateway

@mnapoli
Copy link
Member

mnapoli commented Feb 6, 2022

@t-richard thanks a lot for tracking this!

Maybe our immediate option would be to document this then indeed. PRs are welcome!

@t-richard
Copy link
Member

@mnapoli actually someone already went ahead and opened a PR brefphp/bref#1160

@mnapoli
Copy link
Member

mnapoli commented Feb 6, 2022

👍 it's merged and live: https://bref.sh/docs/frameworks/laravel.html#trusted-proxies

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

5 participants