Skip to content

TransferEncodingChunked may return true after being set to false #116691

Open
@MihaZupan

Description

@MihaZupan

The TransferEncodingChunked getter returns true if any of the values are "chunked".
But the setter only removes the first one.

var headers = new HttpRequestMessage().Headers;

headers.TransferEncoding.Add(new TransferCodingHeaderValue("chunked"));
headers.TransferEncoding.Add(new TransferCodingHeaderValue("chunked"));

headers.TransferEncodingChunked = false;
Console.WriteLine(headers.TransferEncodingChunked); // True

We should probably change the setter to remove all occurrences such that setting the property to false actually means it's now false.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions