Skip to content

Add support for Latin1 header encoding in HttpSysServer. #34330

@avparuch

Description

@avparuch

On IIS (ANCM) : when a request contains a header such as foo:Québec, IIS decodes it as Qu�bec. (The "é" is replaced with codepoint U+FFFD). It is possible to enable Latin1 decoding using AppContext.SetSwitch("Microsoft.AspNetCore.Server.IIS.Latin1RequestHeaders", isEnabled: true); Please see: #22675

On Kestrel : when a request contains a header such as foo:Québec, Kestrel rejects it outright as 400.0 (Bad Request). It is possible to enable Latin1 decoding using KestrelServerOptions.RequestHeaderEncodingSelector property : https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.server.kestrel.core.kestrelserveroptions.requestheaderencodingselector?view=aspnetcore-5.0

However, on HttpSysServer, the option to enable Latin1 decoding is not present.

Describe the solution you'd like

An option to enable Latin1 request header decoding on HttpSysServer similar to Kestrel and IIS (ANCM)

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions