js - integrity link and the script attribute

Reference  https://www.cnblogs.com/zuojiayi/p/7207031.html

script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"

integrity link attribute or the script: javascript order to prevent tampering with the CDN. 

"anonymous"Initiates a cross-domain request (i.e., comprising  Origin: the HTTP header), but does not send any authentication information (i.e., does not send cookie, X.509 certificates and HTTP Basic authentication information). If the server certificate is not given the source station (not set  Access-Control-Allow-Origin: HTTP header ), this picture will be contaminated and limit the use .

 This encrypted hash value integrity to specify the value of the property extracted Explorer (file) is base64 encoded. If the resource which matches a hash value, it will be loaded.

<script><link>The integrity value of at least a string, each string comprising a specific indication hashing algorithm (currently allowed prefix prefix sha256, sha384and sha512), then by a dash, and ends with the actual hash base64 encoding.

Guess you like

Origin www.cnblogs.com/luojiabao/p/11139592.html