-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Improve IsChunked parsing/handling #66720
Copy link
Copy link
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-httpsys
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.feature-httpsys
Type
Fields
Give feedbackNo fields configured for Bug.
This looks to be a regression introduced in #44144. The
IsChunkedmethod in usesLastIndexOf(',')and checks only the substring after the last comma, and for "chunked," the substring after the final comma is empty, andContent-Lengthis not stripped, but at the kernel-level http.sys driver parses theTransfer-Encodingheader correctly and recognizes the "chunked" before the trailing comma. The managed layer thinks the body length is determined byContent-Lengthwhile the kernel layer uses chunked encoding.Kestrel does not appear to be affected by this.
Possible fix (in
Request.csandIISHttpContext.cs):