use Subresource Integrity for externally hosted javascript
browsers will calculate the sha256 hash of the script and compare it to the value of the integrity attribute if the values do not match, the browser will refuse to execute it. note: the shasum is written in base64 encoding, not the (more common) hex format!
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= favicon_link_tag "favicon.ico" %>
|
||||
<%= javascript_include_tag "https://cdn.rawgit.com/jomo/ago.js/master/ago.min.js" %>
|
||||
<%= javascript_include_tag "https://cdn.rawgit.com/jomo/ago.js/master/ago.min.js", crossorigin: :anonymous, integrity: "sha256-xw0JUUdbuZQCVO+QScoxrlEsD4nZGCjMRh9PP8GLhcY=" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<link type="application/atom+xml" rel="alternate" href="<%= blogposts_path(:atom) %>">
|
||||
<%= yield(:site_headers) %>
|
||||
|
||||
Reference in New Issue
Block a user