Closed Flyingdot closed 5 years ago
The fact that MacOS accepts it is more concerning
@JunTaoLuo @Tratcher
Can you get a Wireshark capture? Is it really utf8 on the wire?
@Tratcher Wireshark and I aren't friends, but I tried... and I think the header is encoded as ISO 8859-1. The package dump:
4745 5420 2f61 7069 2f76 616c 7565 7320
4854 5450 2f31 2e31 0d0a 486f 7374 3a20
6865 6164 6572 2d74 6573 742e 7363 6170
702d 636f 7270 2e73 7769 7373 636f 6d2e
636f 6d0d 0a55 7365 722d 4167 656e 743a
2063 7572 6c2f 372e 3631 2e31 0d0a 4163
6365 7074 3a20 2a2f 2a0d 0a74 6573 743a
20e4 0d0a 0d0a
I can read the header correctly as ISO 8859-1 but cannot as UTF-8. Sorry for that, I somehow configured my terminal to use UTF-8, but that doesn't seem to work obviously. So I think your side works as expected.
Is there any workaround to get kestrel to accept a ISO 8859-1 encoded header as well? Because that's what we get in the end from our reverse proxy in production.
No there's not.
Describe the bug
I've noticed you're allowing UTF-8 HTTP Headers since 2.2. (https://github.com/aspnet/KestrelHttpServer/issues/1144). Unfortunately, I still get HTTP 400 back with "Malformed request: invalid headers." for headers with eg. umlauts.
To Reproduce
Steps to reproduce the behavior:
Surprisingly, I tried the same thing on macos and there it worked as expected (same sdk version).
Expected behavior
Kestrel accepts headers with Umlauts.
Additional context
I get the error with Kestrel directly, without any reverse proxy configured.