Allow overriding hostname #191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: allow overriding the request hostname
Fixes subdomain routing for Laravel Sail and multitenant applications by allowing custom host configuration.
Problem
Browser tests fail with subdomain routing because the server was hardcoded to bind to
127.0.0.1, preventing proper subdomain resolution.Solution
This approach is almost the same as the one that got merged: #128
However, instead of modifying HTTP headers, this implementation addresses the root cause by allowing the server binding host to be configured via a new withHost() method that follows the same pattern as userAgent().
Usage
#1593 - Browser testing with subdomains and Laravel Sail
#1443 - Browser testing doesn't work for domain based routing
#1520 - Browser tests for subdomains point to local environment
#1476 - Make it possible to set custom Host header for browser tests