[net9.0] Update default BlazorWebView
host address
#24973
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.
Backport of #24884 to net9.0
Update default BlazorWebView host address
Changes the
BlazorWebView
host address to0.0.0.1
to avoid incompatibility with future browser versions.Description
There have been reports that MAUI Blazor stopped working in iOS 18 and macOS 15. This was due to
BlazorWebView
utilizing0.0.0.0
as a host address, which is blocked in the latest versions of Safari. It was discovered that websites could send requests to0.0.0.0
as a way to bypass Private Network Access, a standard that restricts websites from sending requests to servers on private networks. Chrome will block access to0.0.0.0
starting in Chrome 129, and other browsers may soon follow.This PR changes the default host address in
BlazorWebView
to0.0.0.1
, which is not blocked by browsers and is not subject to the same security risks.Some other considered alternatives were:
localhost
. This has the risk that it may interfere with other applications running on localhost. In fact, the MAUI repo's MacOS automated tests failed when we attemptedlocalhost
.https://blazor/
). Unfortunately, this causes the browser to attempt DNS resolution, which causes the app to take longer to load.Fixes #24363
Customer Impact
Without this fix, MAUI Blazor apps do not work in iOS 18 and macOS 15, and may soon stop working in Android.
Regression?
Whether the bug occurs is a factor of the browser version, not the MAUI version.
Risk
We validated manually that all WebView implementations support
0.0.0.1
. Automated tests validate this as well. There is no indication that browsers will block0.0.0.1
in the near future. In case apps are affected by this change and need to revert to using0.0.0.0
, they can do so via anAppContext
switch.Verification
Packaging changes reviewed?