Skip to content

Log bytes for HTTP/1.1 parsing failures #40745

@Tratcher

Description

@Tratcher

Is there an existing issue for this?

  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions