Charset autodetection doesn't work properly with preload header
Reported by
nazar.mo...@gmail.com,
May 27 2016
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 Example URL: https://github.com/nazar-pc/preload-header-charset-bug Steps to reproduce the problem: 1. Have static Js file with unicode characters served from server with Content-Type application/javascript 2. Have HTML page (utf-8) with preload header for mentioned JS file 3. Try to get content from that JS file (might be value of the variable or something) What is the expected behavior? Unicode characters shown correctly What went wrong? Unicode characters are not shown correctly, JS file is not recognized to be UTF-8 file Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? No Does this work in other browsers? Yes Chrome version: 53.0.2750.0 Channel: canary OS Version: Flash Version: If some other file is preloaded with BOM everything starts working fine, also if file itself has BOM it works fine. Also problem doesn't happen with preload tag. You can open GitHub repository to see reproducible demo.
,
May 27 2016
Yes, specifying charset in Content-Type works fine, also BOM addition works as well (this was simpler workaround in my case). But this is still a bug that should be fixed)
,
May 27 2016
,
May 30 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/727d4183ad164bd4eaa4bde1c82eadb592e1c41c commit 727d4183ad164bd4eaa4bde1c82eadb592e1c41c Author: yoav <yoav@yoav.ws> Date: Mon May 30 15:51:13 2016 Add Document encoding to header preloaded requests When resources were preloaded using Link: headers, they weren't requested with the document's charset, and therefore their decoding might have differed from non-preloaded resources. This CL fixes that by requesting them with the right encoding. BUG= 615307 Review-Url: https://codereview.chromium.org/2019303002 Cr-Commit-Position: refs/heads/master@{#396735} [add] https://crrev.com/727d4183ad164bd4eaa4bde1c82eadb592e1c41c/third_party/WebKit/LayoutTests/http/tests/preload/link_preload_charset.php [add] https://crrev.com/727d4183ad164bd4eaa4bde1c82eadb592e1c41c/third_party/WebKit/LayoutTests/http/tests/preload/resources/charset.js [modify] https://crrev.com/727d4183ad164bd4eaa4bde1c82eadb592e1c41c/third_party/WebKit/Source/core/loader/LinkLoader.cpp
,
May 30 2016
Fixed AFAICT. Please verify and reopen if needed.
,
May 31 2016
Works good now, thanks! Quick question: will it be backported to stable or which target release will contain this fix? I'm not willing to keep workaround forever:)
,
May 31 2016
Currently this will go into Chrome 53. (stable at end of August) I'll request a merge into 52. (current beta, stable at mid July)
,
May 31 2016
Your change meets the bar and is auto-approved for M52 (branch: 2743)
,
May 31 2016
Please have a the CL merged by EOD today(05/31), so it gets picked up for Beta Promotion scheduled on 06/02. Please provide a sample testcase so that team could verify the fix in canary.
,
May 31 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c732f3b13215ca042376f72e361d8a140ea81802 commit c732f3b13215ca042376f72e361d8a140ea81802 Author: Yoav Weiss <yoav@yoav.ws> Date: Tue May 31 21:24:13 2016 Add Document encoding to header preloaded requests When resources were preloaded using Link: headers, they weren't requested with the document's charset, and therefore their decoding might have differed from non-preloaded resources. This CL fixes that by requesting them with the right encoding. BUG= 615307 Review-Url: https://codereview.chromium.org/2019303002 Cr-Commit-Position: refs/heads/master@{#396735} (cherry picked from commit 727d4183ad164bd4eaa4bde1c82eadb592e1c41c) Review URL: https://codereview.chromium.org/2026673003 . Cr-Commit-Position: refs/branch-heads/2743@{#150} Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939} [add] https://crrev.com/c732f3b13215ca042376f72e361d8a140ea81802/third_party/WebKit/LayoutTests/http/tests/preload/link_preload_charset.php [add] https://crrev.com/c732f3b13215ca042376f72e361d8a140ea81802/third_party/WebKit/LayoutTests/http/tests/preload/resources/charset.js [modify] https://crrev.com/c732f3b13215ca042376f72e361d8a140ea81802/third_party/WebKit/Source/core/loader/LinkLoader.cpp
,
May 31 2016
Merged. The test case I used is the one provided with this issue: https://github.com/nazar-pc/preload-header-charset-bug The layout tests include a simplified version of it in http/tests/preload/link_preload_charset.html |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by y...@yoav.ws
, May 27 2016Owner: y...@yoav.ws
Status: Available (was: Unconfirmed)