Просмотр исходного кода

Fix Can't add attachments because of Content-Security-Policy.

Thanks to Ben0it-T and xet7 !

Fixes #4461
Lauri Ojansivu 3 лет назад
Родитель
Сommit
0d9c37b006
3 измененных файлов с 9 добавлено и 0 удалено
  1. 1 0
      .meteor/packages
  2. 1 0
      .meteor/versions
  3. 7 0
      server/policy.js

+ 1 - 0
.meteor/packages

@@ -149,3 +149,4 @@ pascoual:pdfkit
 wekan-accounts-lockout
 lmieulet:meteor-coverage
 meteortesting:mocha
+browser-policy-content

+ 1 - 0
.meteor/versions

@@ -19,6 +19,7 @@ blaze@2.5.0
 blaze-tools@1.1.2
 boilerplate-generator@1.7.1
 browser-policy-common@1.0.11
+browser-policy-content@1.1.1
 browser-policy-framing@1.1.0
 caching-compiler@1.2.2
 caching-html-compiler@1.2.0

+ 7 - 0
server/policy.js

@@ -1,6 +1,13 @@
 import { BrowserPolicy } from 'meteor/browser-policy-common';
 
 Meteor.startup(() => {
+
+  // Default allowed
+  BrowserPolicy.content.allowInlineScripts();
+  BrowserPolicy.content.allowEval();
+  BrowserPolicy.content.allowInlineStyles();
+  BrowserPolicy.content.allowSameOriginForAll();
+
   if (process.env.BROWSER_POLICY_ENABLED === 'true') {
     // Trusted URL that can embed Wekan in iFrame.
     const trusted = process.env.TRUSTED_URL;