about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-11-06 11:56:31 +0100
committerGitHub <noreply@github.com>2020-11-06 11:56:31 +0100
commit9b1f2a4b61660f9a8be62f6296d97a856e376059 (patch)
treedd60029f03394a924d7168277582f0e6c835a9a1 /config
parent68d4b2b83e124719f8473489ee8c1743ca848dc4 (diff)
Add subresource integrity for JS and CSS assets (#15096)
Fix #2744
Diffstat (limited to 'config')
-rw-r--r--config/application.rb2
-rw-r--r--config/webpack/shared.js3
2 files changed, 4 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb
index ad6cf82d7..bf467d6c3 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -22,6 +22,8 @@ require_relative '../lib/mastodon/version'
 require_relative '../lib/devise/two_factor_ldap_authenticatable'
 require_relative '../lib/devise/two_factor_pam_authenticatable'
 require_relative '../lib/chewy/strategy/custom_sidekiq'
+require_relative '../lib/webpacker/manifest_extensions'
+require_relative '../lib/webpacker/helper_extensions'
 
 Dotenv::Railtie.load
 
diff --git a/config/webpack/shared.js b/config/webpack/shared.js
index 667652809..05828aebe 100644
--- a/config/webpack/shared.js
+++ b/config/webpack/shared.js
@@ -79,7 +79,8 @@ module.exports = {
       chunkFilename: 'css/[name]-[contenthash:8].chunk.css',
     }),
     new AssetsManifestPlugin({
-      integrity: false,
+      integrity: true,
+      integrityHashes: ['sha256'],
       entrypoints: true,
       writeToDisk: true,
       publicPath: true,