-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update default
BlazorWebView
host address (#24884)
Update default host address to 0.0.0.1.
- Loading branch information
1 parent
0b84dad
commit fa850a7
Showing
4 changed files
with
23 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.AspNetCore.Components.WebView; | ||
|
||
internal static class HostAddressHelper | ||
{ | ||
private const string AppHostAddressAlways0000Switch = "BlazorWebView.AppHostAddressAlways0000"; | ||
|
||
private static bool IsAppHostAddressAlways0000Enabled => | ||
AppContext.TryGetSwitch(AppHostAddressAlways0000Switch, out var enabled) && enabled; | ||
|
||
public static string GetAppHostAddress() | ||
=> IsAppHostAddressAlways0000Enabled | ||
? "0.0.0.0" | ||
: "0.0.0.1"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters