ytti / oxidized-web

Web UI + RESTful API for Oxidized
118 stars 72 forks source link

oxidized-web in iframe #220

Closed joaodiogo123 closed 3 years ago

joaodiogo123 commented 3 years ago

Hello,

I want to show the Oxidized web frontend in an iframe, but I keep getting the message refused to connect. Can anybody help me with this?

joaodiogo123 commented 3 years ago

As per: https://stackoverflow.com/questions/65675367/iframe-website-refused-to-connect-x-frame-options-is-deny , the "problem" seems to be related with the X-Frame-Options being set to DENY. Which Sinatra does by default (https://stackoverflow.com/questions/7840613/how-do-i-get-sinatra-to-refrain-from-adding-the-x-frame-options-header).

As stated in the last link the solution would be to add set :protection, :except => :frame_options on the app. So I edited /var/lib/gems/2.5.0/gems/oxidized-web-0.13.1/lib/oxidized/web/webapp.rb a added it there.

That seems to have solved the problem. If someone knows a better way or thinks this is not a good way to do it, kindly share your opinion.

Thanks.