Closed jonathanKingston closed 8 years ago
@SlexAxton I think this is similar to what you were seeing. I have a hunch that because the app isn't always sending the UTF8 encoding in the headers Chrome isn't picking that up (trying to fix in express first).
However I think @metromoxie might find this an interesting test case (I have kept the issue from you without a simple reproducible test case that you can dismiss or accept).
Replication steps:
git clone git@github.com:Keeo/ember-sri-moment.git
cd ember-sri-moment; npm install; bower install; ember serve --env=production
Forcing the Content-type encoding doesn't fix this issue as I thought it might :(. Adding in charset="UTF-8"
into the tag didn't help either.
'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর'
'য়া'
This is a simpler reproduction of the issue:
https://github.com/jonathanKingston/sri-encoding-issue
From what I can see this is an issue with Chrome however will contact the core Chrome team to confirm.
Chrome issue filed: https://code.google.com/p/chromium/issues/detail?id=527286
This code in the repository that does the work (broccoli-sri-hash) should fix it: https://github.com/jonathanKingston/broccoli-sri-hash/commit/95c8842c84c0451b3838694cb41d17781de1a4bc
Hesitant to push without more testing; however people are welcome to check. It should just turn off SRI for non ascii files.
:+1: It works for me.
@Keeo thanks so much for checking.
v1.1.0 has now been published which should fix this along with the gzip issue fixed by @taylon
:+1: 1.1.0 is working. Thanks!
This issue will remain open until the hack can be removed as all it is doing is turning off potentially offending code.
Thank you for confirming @lardawge
Fwiw I installed v1.1.0 and still got an SRI error in Chrome 45 in testing mode. Removing this addon fixed it and I haven't had time to look further into it.
@jerel your issue is #2 which @stefanpenner kindly solved within Ember: https://github.com/ember-cli/ember-cli/pull/4796
v1.1.0 fixes the integrity check problems I was having in Chrome 45 :+1:
@BrianTMaurer it looks like the chrome guys are working on a fix.
@stefanpenner Thanks, is there a suggested quick fix to turn off SRI on vendor.js or something?
@BrianTMaurer you can uninstall the addon.
It turns itself off if its on the latest version?
On Fri, Sep 18, 2015 at 4:10 PM Stefan Penner notifications@github.com wrote:
@BrianTMaurer https://github.com/BrianTMaurer you can uninstall the addon.
— Reply to this email directly or view it on GitHub https://github.com/jonathanKingston/ember-cli-sri/issues/5#issuecomment-141478934 .
v1.1.0 does not fix this issue for me, @jonathanKingston. Any advice?
@elwayman02 what is the error you are getting. Sorry for the delay?
This should no longer be an issue. Chrome fixed the issue etc please let me know if other issues are happening etc.
@jonathanKingston just wanted to warn I had a similar issue with a CSS (ember-bootstrap) resource: https://github.com/poetic/ember-cli-github-pages/issues/45
Chrome Version 49.0.2623.39 beta-m (64-bit)
Fixed it by bypassing integrity check,
@benoror any issue with Firefox? This basically shouldn't happen ever... are you able to set it up again on a sub domain or example url etc?
@jonathanKingston I couldn't reproduce the issue in a separate repo:
However I was able to reproduce the issue in my main repo by removin integrity=""
stuff:
I will keep it broken until you can take a look, let me know if there's something else I can do to help.
Disclaimer: I am new to Ember.js development, there's a big chance I'm screwing it somewhere else, anyway it felt right to report it :see_no_evil:
Cheers!
@benoror this isn't the same issue certainly as the one mentioned in this issue... I can reproduce it in Firefox which likely means the files hash is wrong.
Feel free to put it back now to fix your site haha (I'm seeing a broken <div id="content"?
in the source also)! It's a little late here so can't dig much further. However as a rule any manipulation of the JS files after ember has been built will cause this issue, so look out for scripts that mess with whitespace in any shape or form.
Thanks for checking this out and making a reproduction case also!
@jonathanKingston no prob! sorry for the noise, good night! :night_with_stars:
Humour me could you try adding it back in now the HTML is fixed, I'm wondering if HTML's error correction was breaking it.
sure, done, still failing :astonished:
Nevermind was worth a thought. How are you deploying that code to github? I just downloaded the raw file served by github and used the underlying code of this library and it results in a different hash output... so something is different with the code before it hits the server I think.
https://github.com/poetic/ember-cli-github-pages
On Tue, Feb 9, 2016, 19:35 Jonathan Kingston notifications@github.com wrote:
Nevermind was worth a thought. How are you deploying that code to github? I just downloaded the raw file served by github and used the underlying code of this library and it results in a different hash output... so something is different with the code before it hits the server I think.
— Reply to this email directly or view it on GitHub https://github.com/jonathanKingston/ember-cli-sri/issues/5#issuecomment-182161749 .
Sent from my phone (sorry for possible typos) Benjamin Orozco - benoror.com
Hmm looks fine :/
The issue was happening here and seemed to be random, so here's what I did to fix it (for anybody else Googling this). Google Chrome 50.0.2661.102 (64-bit) on Mac OS X 10.11.6 Beta.
ember-cli-sri appears to calculate the SHA256 and SHA512 hashes just fine but randomly Chrome seems to throw a fit about integrity checking. Out of curiosity I downloaded a local copy from ember server of the problem file and the version being served. What I noticed was that in the local copy from Ember some comments were still preserved from ember-cli-uglify, whereas the production file causing the issue was missing them. I'm using CloudFlare as a proxy, which was configured to further minify source files.
Solution for CloudFlare users: Turn off the minifying on CloudFlare and purge the cache. This should fix the integrity issue.
ColtonProvias- I came upon the same solution today as well. I replicated the issue in Chrome, FireFox, and Safari. At first I tested by putting cloudflare into dev mode and things were fine. Turning cloudflare caching back on and turning off cloudflare minification for js resolved the issue. An ember build --environment=production already should minify the js anyway. I didn't see the same issue in our staging environment since SRI is not active.
As @Keeo raised here: https://github.com/jonathanKingston/ember-cli-sri/issues/4#issuecomment-136375407
The output I am getting for
ember build --env=production
are:This seems to be ok when comparing it to the toolbox I use which means there isn't a race condition in play here.
In Chrome 46 Linux this however fails too (reopening as a new issue as I think its likely fairly serious).