Steps to reproduce
We are seeing a problem where the Referer header is encoded wrong for XHR requests when the current url contains non-ascii chars.
The following url illustrates the problem:
We load several resources on page load and when inspecting the Referer header we can see that “ä” is encoded differently for XHR and regular requests.
The complete requests from the developer tools are attached as images.
If we however browse to the page with encoded characters in the url it works as expected and both cases are encoded properly.
The main problem that this causes is that the webserver rejects the whole request with a 400 Bad Request error (running ASP.Net Core with Kestrel behind IIS) since the headers are invalid.
Comments and activity
- Microsoft Edge Team
Changed Assigned To to “Steven K.”
Will you provide a simplified repro for this issue? I have looked at this issue and it appears the UTF-8 characters for the Unicode equivalent symbols, ‘ä’ in this case,
are not getting converted properly. For example:
0xC3A4 - UTF-8(hex) for U+00E4 ä
is being converted into two two byte UTF-8 characters: "0xC383 0xC2A4", which of course is not correct.
I ask for a simplified repro because I see some HTML syntax issues on the site you gave me, which could cause the parser to misinterpret the source URLs. I have attached a screenshot of the console and below is one example where there is a missing quotation mark ‘"’
<div class="content-image rs_skip">
<img src="https://cdn1.ostersundsbibliotek.se/images/5a2fc789193f640af8068179?crop=370x155" role=" presentation"/="">
The mark after the crop=370x155 is missing.
It would be good to verify that the server is encoding the source files as UTF-8 properly and not a cp1252 encoded file but treated it as latin1 or some other similar issue.
Hope you can provide another repro as this is an interesting issue. Appreciate the submission and the help,
A repro can be found at https://rawgit.com/karl-sjogren/edge-15561198-repro/master/file-with-ä-in-filename.html.
The source for the repro is available at https://github.com/karl-sjogren/edge-15561198-repro/