dotnet / dotnet/aspnetcore

Kestrel: Add proper response for invalid header values.

Open
#28,248 2 comments 0 reactions 0 assignees View on GitHub
affected-few area-networking enhancement feature-kestrel severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Describe the bug
There was an issue with the invalid header values on requests. It took a while for us to understand that because there was no indication of what went wrong. In our end, the problem was not using the UTF-8 encoding for headers on the client (Alamofire on iOS). I guess Kestrel only supports UTF-8 or vanilla ASCII, not extensions. That's okay but the problem was there were only Status 400 code and an empty response body.

### To Reproduce
Fire up a kestrel server and send this header value with any request, with ASCII encoding => DEV_NAME, "Müge's iPad"

### Exceptions (if any)
There were only Status 400 code and an empty response body.

### Further technical details
.NET Core version is 3.1.404
It happens on both Windows and Linux Docker containers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.