8000 [9.x] Remove TrustHosts reliance on config helper by axlon · Pull Request #39294 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[9.x] Remove TrustHosts reliance on config helper #39294

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

Merged
merged 1 commit into from
Oct 21, 2021
Merged

[9.x] Remove TrustHosts reliance on config helper #39294

merged 1 commit into from
Oct 21, 2021

Conversation

axlon
Copy link
Contributor
@axlon axlon commented Oct 21, 2021

Redo of #39293.

This PR removes the TrustHosts middleware's reliance on the config() helper, this achieves two things:

  • Developers can now unit test their application's implementation more easily, because they can simply mock the application instance this middleware receives through it's constructor
  • If a developer were to extend Illuminate\Contracts\Foundation\Application::environment() for some reason, the middleware would now take that into account

@taylorotwell taylorotwell merged commit a3e7f48 into laravel:master Oct 21, 2021
@axlon axlon deleted the patch-2 branch October 21, 2021 13:21
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

Successfully merging this pull request may close these issues.

2 participants
0