-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRI not working with Sprockets 4 #393
Comments
@eileencodes I dont know if you want to have a look at this one too, I think it is not related to Rails System Testing but to Sprockets. |
Hrm, I can't imagine this is caused by system tests. Can you reproduce using Capybara and Selenium without system tests? We don't do anything special, it's just a wrapper around those tools. |
This isn't system tests failure, SRI don't work in Sprockets 4.0.0.beta6 and master in all modes |
OK thanks @Fudoshiki - I misread your comment 😄 @renchap can you update the title / info to reflect the new information? Thanks |
I forgot about this issue :) Title updated! |
any plans to fix this? |
This issue is forcing us to stay on v3 for now. |
I'm working around this with We're using digests in asset urls, so (unless I'm missing something) it's totally unnecessary for us to have version as a mechanism for expiring assets. |
Closed by 5038ad5368eb8792465c2eaad453a296ce2180e0 |
When using SRI (
javascript_include_tag '...', integrity: true
) with Sprockets 4, the integrity attribute in the<script>
tag is wrong.I made a small Rails app to reproduce the issue :
There is a
sleep
in the test (https://github.com/renchap/rails-test-app/blob/system-tests-assets-integrity/test/system/home_test.rb#L9) so you can check the Selenium Chrome window's inspector, and see something like :The asset hash is indeed wrong. In the page :
Recalculating the hash to be sure:
I havent looked at how Sprockets calculates the hash, but it is definitely wrong.
The text was updated successfully, but these errors were encountered: