2

dev.example.com で実行されている Express アプリには、次の行があります。

// on my own domain: dev.example.com on port 80
server.use(helmet.xframe('allow-from', 'http://example.com'));
...
server.get('/content', function(req, res) { .... });

example.com:9000 で実行されている別の高速アプリでは、iframe にページ (インデックス) があります。

<div>
   <iframe src="http://dev.example.com/content" width=10 height=10></iframe>
</div>

ただし、example.com/ にアクセスすると、次のエラーが表示されます。

Invalid 'X-Frame-Options' header encountered when loading 'http://dev.example.com/content': 'ALLOW-FROM http://example.com' is not a recognized directive. The header will be ignored. 

私は試した:

server.use(helmet.xframe('sameorigin'));  OR 
server.use(helmet.xframe('allow-from', 'http://example.com:9000'));

それらのどれも機能しません。何か案が?

4

0 に答える 0