Whitelisting de iframes permitidos não funciona - 'x-frame-options: SAMEORIGIN'

A lista de permissões de iframes permitidos não está funcionando para nós. Adicionamos um plugin do GitHub com plugin.rb:

Rails.application.config.action_dispatch.default_headers.merge!({'X-Frame-Options' => 'ALLOWALL'})
Rails.application.config.action_dispatch.default_headers.merge!({'Access-Control-Allow-Origin' => '*'})
Rails.application.config.action_dispatch.default_headers.merge!({'Access-Control-Allow-Methods' => 'GET, POST, OPTIONS, DELETE'})
Rails.application.config.action_dispatch.default_headers.merge!({'Access-Control-Allow-Headers' => 'Content-Type, Authorization, X-Requested-With'})

mas, por algum motivo, o Discourse continua revertendo para
x-frame-options: SAMEORIGIN
image

Tudo funciona em http localhost, mas quando implantado em https, nada funciona.

Olá e bem-vindo @boazcstrike :slight_smile:

Acho que houve um problema semelhante nesta postagem recente Iframe allow attribute not working - #13 by gilby. Acho que @falco está investigando isso, então ele pode ter mais informações?

Olá Jammy!

Finalmente conseguimos fazer funcionar.

Havia uma configuração oculta chamada allow_embedding_site_in_an_iframe e nós a definimos como true dentro do aplicativo Rails:

SiteSetting.allow_embedding_site_in_an_iframe = true

Obrigado! :smiley:

2 curtidas

Ainda melhor. :slight_smile: Fico feliz que você conseguiu fazer funcionar. :+1:

1 curtida

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.