From 0d83569899155e5d5c17fff0c69e533df2f34d42 Mon Sep 17 00:00:00 2001
From: Eugen <eugen@zeonfederated.com>
Date: Sat, 15 Apr 2017 22:48:30 +0200
Subject: [PATCH] Fix cross-origin integrity (#1871)

See <https://glitch.social/users/bea/updates/434>
---
 app/views/home/index.html.haml       | 2 +-
 app/views/layouts/admin.html.haml    | 2 +-
 app/views/layouts/auth.html.haml     | 2 +-
 app/views/layouts/embedded.html.haml | 2 +-
 app/views/layouts/public.html.haml   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index 5b6f5b855..df4223ed2 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -1,6 +1,6 @@
 - content_for :header_tags do
   %script#initial-state{:type => 'application/json'}!= json_escape(render(file: 'home/initial_state', formats: :json))
 
-  = javascript_include_tag 'application', integrity: true
+  = javascript_include_tag 'application', integrity: true, crossorigin: 'anonymous'
 
 = react_component 'Mastodon', default_props, class: 'app-holder', prerender: false
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index fa364750f..892bcd596 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -1,5 +1,5 @@
 - content_for :header_tags do
-  = javascript_include_tag 'application_public', integrity: true
+  = javascript_include_tag 'application_public', integrity: true, crossorigin: 'anonymous'
 
 - content_for :content do
   .admin-wrapper
diff --git a/app/views/layouts/auth.html.haml b/app/views/layouts/auth.html.haml
index bf4113baf..899690419 100644
--- a/app/views/layouts/auth.html.haml
+++ b/app/views/layouts/auth.html.haml
@@ -1,5 +1,5 @@
 - content_for :header_tags do
-  = javascript_include_tag 'application_public', integrity: true
+  = javascript_include_tag 'application_public', integrity: true, crossorigin: 'anonymous'
 
 - content_for :content do
   .container
diff --git a/app/views/layouts/embedded.html.haml b/app/views/layouts/embedded.html.haml
index c34247c91..562be6625 100644
--- a/app/views/layouts/embedded.html.haml
+++ b/app/views/layouts/embedded.html.haml
@@ -3,6 +3,6 @@
   %head
     %meta{:charset => 'utf-8'}/
     = stylesheet_link_tag 'application', media: 'all'
-    = javascript_include_tag 'application_public', integrity: true
+    = javascript_include_tag 'application_public', integrity: true, crossorigin: 'anonymous'
   %body.embed
     = yield
diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml
index 56781a286..fdde0a681 100644
--- a/app/views/layouts/public.html.haml
+++ b/app/views/layouts/public.html.haml
@@ -1,5 +1,5 @@
 - content_for :header_tags do
-  = javascript_include_tag 'application_public', integrity: true
+  = javascript_include_tag 'application_public', integrity: true, crossorigin: 'anonymous'
 
 - content_for :content do
   .container= yield