dotnet / dotnet/aspnetcore

Log bytes for HTTP/1.1 parsing failures

Open
#40,745 5 comments 0 reactions 0 assignees View on GitHub
area-networking feature-kestrel
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

HTTP/1.1 request formats are not well standardized and clients often bend/break the spec. This can cause Kestrel to reject the request with a 4XX. When this happens, it can be hard for the app to understand exactly what was wrong with the request.

### Describe the solution you'd like

When a parsing failure is encountered, we should report the raw bytes from the request buffer. This will bypass the common debugging step of "please capture a network trace" and is even better than a network trace because it can capture the decrypted content when using TLS.

### Additional context

Where should this be reported? In the BadRequest event?

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.