Skip to content

Commit aa475c7

Browse files
Copilotwadepicketttdykstra
authored andcommitted
Document Safari's lack of *.localhost domain support (dotnet#36374)
* Initial plan * Add Safari compatibility note to localhost-tld.md Co-authored-by: wadepickett <[email protected]> * Apply suggestions from code review - clarified "client" app. * Update aspnetcore/test/localhost-tld.md Co-authored-by: Tom Dykstra <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: wadepickett <[email protected]> Co-authored-by: Wade Pickett <[email protected]> Co-authored-by: Tom Dykstra <[email protected]>
1 parent 8fc8049 commit aa475c7

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

aspnetcore/test/localhost-tld.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how using localhost as top-level domain can make testing easi
44
monikerRange: '>= aspnetcore-10.0'
55
ms.author: tdykstra
66
ms.custom:
7-
ms.date: 08/26/2025
7+
ms.date: 11/19/2025
88
title: Support for the .localhost top-level domain
99
uid: test/localhost-tld
1010
---
@@ -23,7 +23,9 @@ ASP.NET Core's built-in HTTP server, Kestrel, correctly treats any `*.localhost`
2323

2424
## Browser compatibility
2525

26-
While web browsers automatically resolve `*.localhost` names to the local loopback address, other apps might treat `*.localhost` names as regular domain names and attempt to resolve them via their corresponding DNS stack. If your DNS configuration doesn't resolve `*.localhost` names to an address, they fail to connect. You can continue to use the regular `localhost` name to address your apps when not in a web browser.
26+
While most modern evergreen browsers automatically resolve `*.localhost` names to the local loopback address, Safari on macOS doesn't support this feature. In Safari, you should use the regular `localhost` name instead of `*.localhost` domain names.
27+
28+
Some client apps other than Safari and evergreen web browsers treat `*.localhost` names as regular domain names and attempt to resolve them via their corresponding DNS stack. If your DNS configuration doesn't resolve `*.localhost` names to an address, they fail to connect. You can continue to use the regular `localhost` name to address your apps when not in a web browser.
2729

2830
## HTTPS development certificate
2931

aspnetcore/tutorials/first-mvc-app/controller-methods-views.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ By [Rick Anderson](https://twitter.com/RickAndMSFT)
1818

1919
We have a good start to the movie app, but the presentation isn't ideal, for example, **ReleaseDate** should be two words.
2020

21-
![Index view: Release Date is one word (no space) and every movie release date shows a time of 12 AM](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png)
21+
![Index view: Release Date is one word (no space) and every movie release date shows a time of 12 AM](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90_not_formatted.png)
2222

2323
Open the `Models/Movie.cs` file and add the highlighted lines shown below:
2424

2525
[!code-csharp[](~/tutorials/first-mvc-app/start-mvc/sample/mvcmovie90/Models/Movie.cs?name=snippet_Second&highlight=2,3,12,13,16)]
2626

2727
`DataAnnotations` are explained in the next tutorial. The [Display](xref:System.ComponentModel.DataAnnotations.DisplayAttribute) attribute specifies what to display for the name of a field (in this case "Release Date" instead of "ReleaseDate"). The [DataType](xref:System.ComponentModel.DataAnnotations.DataTypeAttribute) attribute specifies the type of the data (Date), so the time information stored in the field isn't displayed.
2828

29+
Using the data annotations above, run the application and refresh the `/Movies` page. Because the view markup uses the `@Html.DisplayNameFor` and `@Html.DisplayFor` methods to render the property name and value, the updated `Index` view shows all the fields properly formatted. For example, **Release Date** is now two words and the time information is no longer shown.
30+
31+
![Index view: Release Date is two words and every movie release date is shown without the time](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90_formatted.png)
32+
2933
The `[Column(TypeName = "decimal(18, 2)")]` data annotation is required so Entity Framework Core can correctly map `Price` to currency in the database. For more information, see [Data Types](/ef/core/modeling/relational/data-types).
3034

3135
Browse to the `Movies` controller and hold the mouse pointer over an **Edit** link to see the target URL.

aspnetcore/tutorials/first-mvc-app/working-with-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Test the app. Stop it and restart it so the `SeedData.Initialize` method runs an
120120

121121
The app shows the seeded data.
122122

123-
![MVC Movie app open in Microsoft Edge showing movie data](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90.png)
123+
![MVC Movie app open in Microsoft Edge showing movie data](~/tutorials/first-mvc-app/working-with-sql/_static/9/m90_not_formatted.png)
124124

125125
> [!div class="step-by-step"]
126126
> [Previous: Adding a model](~/tutorials/first-mvc-app/adding-model.md)
-45.6 KB
Loading
78.7 KB
Loading
79.5 KB
Loading

0 commit comments

Comments
 (0)