next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.31k stars 411 forks source link

Fixed a bug where the SRI hash in _vendors.yml is incorrect #727

Closed 1nj0k closed 5 months ago

1nj0k commented 5 months ago

Fixed a bug where the SRI hash is incorrect.

PR Checklist

PR Type

What is the current behavior?

https://theme-next.js.org/

The website can not display the content, and the console send an error message.

None of the “sha256” hashes in the integrity attribute match the content of the subresource. The computed hash is “vO75T5ZEgfdoDZXn+75ajCDTlFqSanVIdImKV423x6s=”.

Issue resolved: After checking the page source code, I found there is a mistake with "https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.2/anime.min.js" hash value. Then I change it from "sha256-tc4b48P1MPGS4PJXHRlChGCW1mEZy62jS/3JEsSHPzU=" to "sha256-vO75T5ZEgfdoDZXn+75ajCDTlFqSanVIdImKV423x6s=", it works.

What is the new behavior?

The website can display content after using the correct SRI hash value.

welcome[bot] commented 5 months ago

Thanks so much for opening your first PR here!

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 7076058369


Totals Coverage Status
Change from base Build 7071252829: 0.0%
Covered Lines: 394
Relevant Lines: 399

💛 - Coveralls
stevenjoezhang commented 5 months ago

The core issue is that the anime.js 3.2.2 file on cdnjs and jsdelivr is different (which is rare situation). Modifying it this way will cause the SRI check on jsdelivr to fail. I think we need to roll back to the previous version of anime.js and release a new version of the theme.

njzjz commented 5 months ago

Unpkg gives the same result as jsdelivr so the issue may come from cdnjs.

njzjz commented 5 months ago

Maybe related: https://github.com/cdnjs/cdnjs/issues/14210

1nj0k commented 5 months ago

The core issue is that the anime.js 3.2.2 file on cdnjs and jsdelivr is different (which is rare situation).

It's really a rare problem. I also think rollback is a good idea.

njzjz commented 5 months ago

cdnjs said they cannot ensure the compressed file is the same as that in the source code