forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid modifying the JavaScriptEncoder on SystemTextJsonOutputFormatter
By default, STJ encodes most non-ASCII characters which is different from Newtonsoft.Json's defaults. When we first defaulted to STJ in 3.1, MVC attempted to minimize this difference by using a more compatible (unsafe-relaxed) encoding scheme if a user hadn't explicitly configured one via JsonOptions. As noted in dotnet#38720, this causes issues if a JsonSerializerContext is configured. This PR changes the output formatter to no longer change the JavaScriptEncoder. Users can manually configure the unsafe-relaxed encoding globally if they understand the consequences of doing so. Contributes to dotnet#38720
- Loading branch information
Showing
6 changed files
with
244 additions
and
98 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
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
Oops, something went wrong.