-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Edge, when referer url contains Chinese characters, MVC will respond code 400 #8396
Comments
@HumJ0218 can you set the log level to |
Kestrel will reject this. I've asked @JunTaoLuo to reproduce it and check the raw bytes. |
Kestrel rejects non-ascii headers, aspnet/KestrelHttpServer#1144. UTF-8 encoding was added in 2.2.0-preview2 but I still don't think this request will be accepted since it doesn't look like it's UTF-8. I'll see if I can reproduce the issue and see what encoding is being used. |
Looks like this is a dupe of aspnet/KestrelHttpServer#1144. The @HumJ0218 Can you try 2.2.0-preview2 when it releases to see if this issue is resolved? We started to accept requests with UTF-8 encoded header values in this release. |
@JunTaoLuo Thank you I will try it in 2.2.0-p2 ASAP |
It looks like Edge will encode the address I request, but not encode it when in others header content |
I'm not sure if it would be a bug. According to spec, query string should be percent encoded: https://tools.ietf.org/html/rfc3986#section-3.4 (pchar is defined at https://tools.ietf.org/html/rfc3986#section-3.3). I think this is the reason why Chrome and Edge will encode the path line. However, I don't think there's a specified defined client behaviour in terms of header values so it's unlikely that this is a "bug" but rather just different client behaviour and implementation. |
@HumJ0218 Also, I'm assuming by "encode" you mean percent encoding? From the repro you have shown, the header values are still encoded by Edge, but the encoding it's using is UTF-8 instead of percent encoding. |
This is a test Look at the first request, Edge sent (WHAT?) instead of "测试"?!!! It's NOT %percent% encoding😂 but DO split to UTF-8 bytes and transfer in ASCII? I'm confused |
maybe it's Edge's bug not Server‘s |
|
@HumJ0218 What version of Edge and Windows are you running on? I cannot reproduce this locally on my machine. |
Windows 10 pro 1803 x64 , version 17134.228 ( zh-CN ) Edge 42.17134.1.0 User-Agent: should I upgrade them ? |
Either I type If it's |
I've tested this in a VM and I'm able to reproduce it on a Chinese version of Windows 10. I can confirm this is a duplicate of aspnet/KestrelHttpServer#1144 and using 2.2.0-preview2 that will be released tomorrow will fix the issues: Note that there is a bug with how Edge on a Chinese Windows 10 installation presents query string and headers in the developer tools view but both are sent as valid UTF-8 to the server. |
Thank you for your time!! |
I'm going to close this issue for now since we have an understanding of the underlying issue and there's no actionable items on our side. Let us know if you encounter any other issues. |
hi i am facing exactly the same issue only on ms edge. can you tell me how you fixed this issue? |
@ghulamhussain upgrade to 2.2.0-preview2. |
Is this a Bug or Feature request?:
BUG
Steps to reproduce (preferably a link to a GitHub repo with a repro project):
\0. Use browser Edge
\1. goto a url whitch contains Chinese characters like "http://localhost:60000/测试"
\2. goto a url hosted by Core MVC like "http://localhost:60000/anyone" or load other resources in \1's page
![avatar](https://camo.githubusercontent.com/9c30b3679a677cda41ed8d023b70db2bcdb0e83f045bef4efe69841bab4280f4/68747470733a2f2f6f7373322e68756d70687265796a2e636f6d2f696d6167652f32303138303930362f332e706e67)
![avatar](https://camo.githubusercontent.com/2de46dc8f316b3b51701d5d31c0eced97362637a43147b10031fa119b13937f4/68747470733a2f2f6f7373322e68756d70687265796a2e636f6d2f696d6167652f32303138303930362f312e706e67)
-- Edge will encode the request header "Referer" with octal encoding like "http://localhost:60000/\123\234\345...." (i don't remember detail, but it just like this, i got it by wireshark)
\3. Core MVC will return a response with http code 400
![avatar](https://camo.githubusercontent.com/7820623dde6bc26129a2ea65fcbda8a37db577db58daf4d49c22987e39673d03/68747470733a2f2f6f7373322e68756d70687265796a2e636f6d2f696d6167652f32303138303930362f322e706e67)
\4. whatever it's stand-alone or hosted by iis
\7. when it's others website server, like ##asp.net 4 mvc, it will return code 200 just as usual
Description of the problem:
Maybe if Core MVC dosen't decode the octal-encoded header?
Version of
Microsoft.AspNetCore.Mvc
orMicrosoft.AspNetCore.App
orMicrosoft.AspNetCore.All
:.Net Core 2.0
Microsoft.AspNetCore.All 2.0.9 --(it is the newest version in core 2.0)
Microsoft.NETCore.App 2.0.0
The text was updated successfully, but these errors were encountered: