SORU
4 EKİM 2014, CUMARTESİ


Aykırı İçerik Güvenliği Politikası yönergesi sonra kor-cli 0.0.47 yükseltme

0.0.47 için kor-cli uygulamam yükselttim ve şimdi benim tarayıcı hataları bir sürü içerik güvenlik politikası ile ilgili konsol alıyorum. Bu sorunu nasıl düzeltebilirim?

Refused to load the script 'http://use.typekit.net/abcdef.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' localhost:35729".
 login:1
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' localhost:35729". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
 login:20
Refused to load the script 'http://connect.facebook.net/en_US/all.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' localhost:35729".
 login:1
Refused to load the script 'http://maps.googleapis.com/maps/api/js?libraries=places' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' localhost:35729".

Burada app/index.html benim dosya: satır

<script type="text/javascript" src="//use.typekit.net/abcdef.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places"></script>

CEVAP
4 EKİM 2014, CUMARTESİ


http://content-security-policy.com/ https://github.com/rwjblue/ember-cli-content-security-policy, ben de bazı dokümanlar okuduktan sonra benim config/environment.js bazı politikalar gibi dosya ekledi:

module.exports = function(environment) {
  var ENV = {
    contentSecurityPolicy: {
      'default-src': "'none'",
      'script-src': "'self' 'unsafe-inline' 'unsafe-eval' use.typekit.net connect.facebook.net maps.googleapis.com maps.gstatic.com",
      'font-src': "'self' data: use.typekit.net",
      'connect-src': "'self'",
      'img-src': "'self' www.facebook.com p.typekit.net",
      'style-src': "'self' 'unsafe-inline' use.typekit.net",
      'frame-src': "s-static.ak.facebook.com static.ak.facebook.com www.facebook.com"
    },

  // ...
};

Bu hemen tüm hataları ortadan kaldırıyordu, ama benim app gezinmek başlar başlamaz, yenilerini S3 medya kaynakları ile ilgili ortaya çıktı.

Bu herhangi bir dış kaynak içermeyen uygulamalar için çalıştığından emin değilim, ama kaldırmak için karar verdim ""kor-cli-içerik-güvenlik politikası" benim paketten.json dosyası.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Arun Kumar

    Arun Kumar

    18 Mart 2010
  • Jorrit Jongma

    Jorrit Jongm

    17 Ocak 2008
  • SHAYTARDS

    SHAYTARDS

    1 EKİM 2008