0

I have generated the SHA-256 and added in the integrity tag like below.

<script type="text/javascript" integrity="sha256-65DEQpj8HBSb+/YImG+9LCeuQeRkm5NMpJWTH6hSuFZ+" src="example.com/media/js/90a8720cd608ccab8eaf40398728caf8.js">

I am getting the below error in the console:

Failed to find a valid digest in the 'integrity' attribute for resource 'example.com/media/js/90a8720cd608ccab8eaf40398728caf8.js' with computed SHA-256 integrity "65DEQpj8HBSb+/YImG+9LCeuQeRkm5NMpJWTH6hSuFZ+" The resource has been blocked.

I have also tried with SHA-384 and SHA-512.

Thanks.

3
  • the script you draw in(maybe in CDN) has changed.But your html used integrity to ensure the file not changed.... Sep 9, 2019 at 6:27
  • try with <script src="example.com/media/js/90a8720cd608ccab8eaf40398728caf8.js" integrity="sha256-65DEQpj8HBSb+/YImG+9LCeuQeRkm5NMpJWTH6hSuFZ+" crossorigin="anonymous"></script> Sep 9, 2019 at 6:29
  • The file name is the same. I have tried with attribute crossorigin="anonymous", but still getting the same error. Sep 9, 2019 at 6:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.