2016-11-07 17 views
0

Firebaseでホストされているページにiframeを使用する必要がありますが、そのフレームにはX-Frame-Optionsエラーが表示されます.iframeの1つはpicasaでホストされているギャラリー用ですお問い合わせフォームのためのanohter ifrmae(私はfirebaseを介して送信した電子メールをcouldntのため:()firebaseはX-Frame-Optionsでiframeエラーを受け取ります

ここでは、エラー

Refused to display 'https://get.google.com/albumarchive/pwa/11111/album/1111?source=pwa#slideshow/1111' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. 
jquery.min.js:2 Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://demodomain.com" from accessing a cross-origin frame. 

である私はfirebase.jsonでこれをしなかったが、didntのは、あなたが持っている

"headers": [ 
    { 
     "source": "**/*", 
     "headers": [ 
     {"key": "X-Content-Type-Options", "value": "nosniff"}, 
     {"key": "X-Frame-Options", "value": "ALLOW"}, 
     {"key": "X-UA-Compatible", "value": "ie=edge"}, 
     {"key": "X-XSS-Protection", "value": "1; mode=block"} 
     ] 
    } 
] 
+0

あなたは、このための任意の解決策を見つけますか? – Goyllo

答えて

0

を働きましたあなたが間違った価値を設定しているという正しい考え。 ALLOWは、X-Frame-Optionsヘッダーに許容される値ではありません。 ALLOW-FROMの値を設定し、埋め込み可能なURIを指定することができます。以下のドキュメントをご覧ください。

FIX:

"headers": [{ 
    "source": "**/*", 
    "headers": [ 
    {"key": "X-Content-Type-Options", "value": "nosniff"}, 
    {"key": "X-Frame-Options", "value": "ALLOW-FROM https://get.google.com"}, 
    {"key": "X-UA-Compatible", "value": "ie=edge"}, 
    {"key": "X-XSS-Protection", "value": "1; mode=block"} 
    ] 
}] 

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

関連する問題