Skip to content
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

Updated Fontawesome *.min.css files to resolve integrity check errors #335

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

guidemetothemoon
Copy link
Contributor

@guidemetothemoon guidemetothemoon commented Mar 24, 2022

P.S. It's my first time contributing, apologies in case something is missing - I've tried to follow the established contribution guidelines :)

Description

Changes related to this issue: #299 cause integrity check errors provided below. These errors happen once you attempt to use social media icons for instance:

Failed to find a valid digest in the 'integrity' attribute for resource '<website>/fontawesome/css/solid.min.6ee9fbc38b1b14c99d05fdc597d9af749968eaf84e43050a6d059cad81a60bcc.css' with computed SHA-256 integrity 'TrP1Z4d6t0hI+yNEp2g3zJtsxCrjYjY0jF9GcV/frWc='. The resource has been blocked.

Failed to find a valid digest in the 'integrity' attribute for resource '<website>/fontawesome/css/brands.min.4bfdb43d33551d871070eb4a2ad6fd6e0d1910839cd73d763698f1db19049ddc.css' with computed SHA-256 integrity '3BDi1rr/CfGlgp184RZ2z0fUQpCkpNkdu0YJdlzdmhE='. The resource has been blocked.

Failed to find a valid digest in the 'integrity' attribute for resource '<website>/fontawesome/css/fontawesome.min.3eab8ef80d1761270f30323d1bd5d9d10a8f6a7610dbe233adba89094ed48fbd.css' with computed SHA-256 integrity 'E3K98f0smgriSX7SBZWMREv8HAM28mqcd9hcqPvnzlg='. The resource has been blocked.

The reason for these errors is that the initial changeset added 3 *.min.css files:

  • brands.min.css
  • fontawesome.min.css
  • solid.min.css

...but in the wrong format. Instead of being a one-liner, these files were indented and pretty-formatted which is different from the original source: https://cdnjs.com/libraries/font-awesome/6.0.0 and therefore gets a different checksum generated.
The fix for this is to add properly compressed .min.css files. Files are taken from the original CDN, version 6.0.0 which is currently the one being used by Anatole theme.
The fix has been tested both on Desktop and mobile version of the theme.

Issue Number:

  • Here Goes the Issue Number with a '#'
    Comment: no issue was created for this, I've discovered it during testing the newest version of the theme on my website.

Additional Information (Optional)

  • Here goes any Additional Information you would like to add.

Checklist

Yes, I included all necessary artifacts, including:

  • Tests
  • Documentation
  • Implementation (Code and Ressources)
  • Example
    Comment: this is a fix for an issue and no new functionality is added, therefore no additional artifacts are provided.

Testing Checklist

Yes, I ensured that all of the following scenarios were tested:

  • Desktop Light Mode (Default)
  • Desktop Dark Mode
  • Desktop Light RTL Mode
  • Desktop Dark RTL Mode
  • Mobile Light Mode
  • Mobile Dark Mode
  • Mobile Light RTL Mode
  • Mobile Dark RTL Mode

Notify the following users

  • List users with @ to send Notifications
    @lxndrblz

@netlify
Copy link

netlify bot commented Mar 24, 2022

Deploy Preview for anatole-demo ready!

Name Link
🔨 Latest commit d5fbd52
🔍 Latest deploy log https://app.netlify.com/sites/anatole-demo/deploys/623c260b78a44f0008941721
😎 Deploy Preview https://deploy-preview-335--anatole-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sonarcloud
Copy link

sonarcloud bot commented Mar 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@guidemetothemoon guidemetothemoon marked this pull request as ready for review March 24, 2022 08:05
@lxndrblz lxndrblz self-assigned this Mar 24, 2022
@lxndrblz lxndrblz added the bug Something isn't working label Mar 24, 2022
@lxndrblz
Copy link
Owner

@guidemetothemoon Thanks for your PR. I totally agree that the files should be minified if they carry "min" in their name.

The one thing that baffles me a bit is why you got the integrity error as Hugo will calculate the hash over the files no matter if the content is pretty printed or minified. I think if this had been a global problem, it would have came up quite quickly. Nevertheless I will go ahead and merge the PR. Thanks again.

Copy link
Owner

@lxndrblz lxndrblz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guidemetothemoon LGTM. Thanks for the PR.

@lxndrblz lxndrblz merged commit 0e03d3f into lxndrblz:master Mar 24, 2022
@guidemetothemoon
Copy link
Contributor Author

Thanks for the review!
I agree, I did some research and was surprised that no issues from others were raised for the same. I first thought that the issue may have been related to the line endings but after some tweaking back and forth I ended up with current resolution. Could it be that if the content is not minified, then the checksum is still different because the content kind of changes in terms of size? That's what I saw in this case at least. Or maybe this has something to do with how template is set up? I'm using the traditional set up as a Git submodule. But anyway, happy to help!
And thanks for this theme - I'm actively using it for my tech blog and absolutely love it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants