Update APP_URL
to end in .localhost
#333
Closed
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.
While
.test
is convenient for developers using Laravel Valet, it provides an obstacle for users that don't. PR #240 improved this problem by first checking that the domain resolves correctly. My PR should improve this even further by not requiring DNS modifications for users that aren't using Valet while still allowing them to usemy-app-name.localhost
.According to the W3 specification, domains ending in
.localhost
are intended to be treated specially, only resolving as loopback addresses. This means using.localhost
will allow the browser to treat the site as a secure context, allowing developers to use features that would normally require HTTPS (such as the Geolocation API).This does not break existing features because it only applies to new installations as well as keeps the
canResolveHostname
check with fallback tohttp://localhost
in case the DNS resolution fails. In addition, developers using Valet can still use either.test
or.localhost
.