iframe无法在heroku上运行 [英] Iframe not working on heroku

查看:89
本文介绍了iframe无法在heroku上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码

  <iframe src="http://matrix.crebtools.com/Matrix/public/IDX.aspx?idx=5a251ec" width="860px" height="520px"></iframe>

它在本地工作,但在heroku上不工作 在heroku上显示空白空间

It work locally but its not working on heroku On heroku it shows white empty space

所以我将这段代码放入了application.rb中,但仍然无法正常工作

so i put in application.rb this code but its still not working

在applications.rb

In applications.rb

module MohamedHatata
  class Application < Rails::Application

    config.action_dispatch.default_headers = {
  'X-Frame-Options' => 'ALLOWALL'
}
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.
    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
  end
end

我花了两天时间尝试找出解决方案,请任何人帮助我

I spend two days just to try figure out the solution please any one help me

这是我的网站 https://mohamed-hatata.herokuapp.com/downsizes/new

推荐答案

如果打开JavaScript控制台,则会显示mixed content警告.

If you open your javascript console you will find mixed content warning.

混合内容:位于的页面 " https://mohamed-hatata.herokuapp.com/downsizes/new 已加载超过 HTTPS,但请求了不安全的资源 ' http://matrix.crebtools.com/Matrix/public/IDX. aspx?idx = 5a251ec ".这 请求已被阻止;内容必须通过HTTPS提供.

Mixed Content: The page at 'https://mohamed-hatata.herokuapp.com/downsizes/new' was loaded over HTTPS, but requested an insecure resource 'http://matrix.crebtools.com/Matrix/public/IDX.aspx?idx=5a251ec'. This request has been blocked; the content must be served over HTTPS.

如果您访问的站点是http://mohamed-hatata.herokuapp.com/downsizes/new而不是https://mohamed-hatata.herokuapp.com/downsizes/new,则iframe加载会很好.

If you visit your site at http://mohamed-hatata.herokuapp.com/downsizes/new instead of https://mohamed-hatata.herokuapp.com/downsizes/new your iframe loads fine.

config.action_dispatch.default_headers由要在应用程序内部加载的网站设置,而不是由应用程序本身设置.

config.action_dispatch.default_headers is to be set by the site which is getting loaded inside your application and not by your application itself.

详细了解混合内容- https://developer.mozilla.org/en/docs/Security/MixedContent

这篇关于iframe无法在heroku上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆