]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Adding subresource hashes to CDN links.
authorChris Barry <chris@barry.im>
Tue, 29 Sep 2015 02:12:57 +0000 (22:12 -0400)
committerChris Rebert <code@chrisrebert.com>
Sat, 24 Oct 2015 05:22:57 +0000 (22:22 -0700)
In Firefox 43 and Chrome 45 there will be support for Subresource
Iintegrity (SRI). More information here:
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity

Closes #17729 by merging a tweaked version of it.

_config.yml
docs/_includes/getting-started/download.html

index 1ee942284853b8f0e6067774e5b06ce5c174e213..39abfb7fdc7959349e6da533e1c8490c4a93998d 100644 (file)
@@ -27,6 +27,10 @@ blog:             http://blog.getbootstrap.com
 expo:             http://expo.getbootstrap.com
 
 cdn:
+  # See https://www.srihash.org for info on how to generate the hashes
   css:            https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
+  css_hash:       "sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ=="
   css_theme:      https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css
+  css_theme_hash: "sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX"
   js:             https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
+  js_hash:        "sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ=="
index bc25122bdefdb6e24c797ca77f3b008cd7086f13..1fb3aab615f6d2cae9327e74f2ccac61a34752eb 100644 (file)
   <p>The folks over at <a href="https://www.maxcdn.com/">MaxCDN</a> graciously provide CDN support for Bootstrap's CSS and JavaScript. Just use these <a href="https://www.bootstrapcdn.com/">Bootstrap CDN</a> links.</p>
 {% highlight html %}
 <!-- Latest compiled and minified CSS -->
-<link rel="stylesheet" href="{{ site.cdn.css }}">
+<link rel="stylesheet" href="{{ site.cdn.css }}" integrity="{{ site.cdn.css_hash }}" crossorigin="anonymous">
 
 <!-- Optional theme -->
-<link rel="stylesheet" href="{{ site.cdn.css_theme }}">
+<link rel="stylesheet" href="{{ site.cdn.css_theme }}" integrity="{{ site.cdn.css_theme_hash }}" crossorigin="anonymous">
 
 <!-- Latest compiled and minified JavaScript -->
-<script src="{{ site.cdn.js }}"></script>
+<script src="{{ site.cdn.js }}" integrity="{{ site.cdn.js_hash }}" crossorigin="anonymous"></script>
 {% endhighlight %}
 
   <h2 id="download-bower">Install with Bower</h2>