-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTF-8 BOM is added to raw value response when running on ASP .NET Core 3+ #628
Comments
The change in behavior you describe seems to indeed exist: However, it appears to have been made in AspNetCore 3. You sure this only happens in 5+? Also, you mention For future reference, actual link: AspNetCoreOData/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatter.cs Lines 197 to 207 in 69eec03
|
Indeed, 3.x also suffers from this issue.
Just a typo. However all collection returning properties are affected. |
@VirusQuartirus |
I don't have write permissions to this repo. |
That's usually how it works with public repositories. You don't create branches directly in the target repo: instead, you fork the repository to your account, make your branch and changes there, and then submit a pull request to the target repo from your fork. This flow doesn't require you any kind of write permission on the target repo. |
Thanx for the tip. PR is created #630 |
Assemblies affected
ASP.NET Core OData 7.x
Describe the bug
When client sends request that expects raw value to be returned ($count for example) and doesn't specify
Accept-Charset
header UTF-8 BOM is written prior to content andContent-Type: text/plain
. This happens when application is built using ASP .NET Core5+3+.Reproduce steps
See attached Fiddler logs.
Possible solution
It looks like ASP .NET Core 5 changed behavior of
Microsoft.AspNetCore.Http.Headers.RequestHeaders
class and now properties likeAcceptEncodingAcceptCharset
return empty collection instead of null value. It looks like it may be fixed inODataOutputFormatter.WriteResponseHeaders
change current lineto
FiddlerLogs.zip
The text was updated successfully, but these errors were encountered: