Skip to content

Expect: 100-Continue header auto-added on HttpClient request on Linux #18674

@lukeamcmurray

Description

@lukeamcmurray

Hi, we have an issue whereby an 'Expect: 100-Continue' header is being automatically added to all HttpClient POST/PUT requests when our .NET Core web api service is deployed to a linux environment (specifically Ubuntu 14.04/16.04). The header is not added when the service is run in a windows environment, both from within Visual Studio and directly in the console using dotnet run.

Logging of the headers of the HttpClient in the service prior to calling SendAsync shows that the Expect header is not set, however logging of the HTTP requests on the server using tcpdump show that it is being set.

I have tried to remove the headers via, client.DefaultRequestHeaders.ExpectContinue = false; and client.DefaultRequestHeaders.Expect.Clear(); however they are still added.

Our issue is that our service must pass through a squid proxy whose version does not support the Expect header. We do not have control over this proxy and it's unlikely we will be able to update the version in the near future.

Cheers,
Luke

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions