-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force https links in iframe #3472
Comments
Hi @paul-mesnilgrente ! Did you set the Rails config |
|
Did you ever figure this out? |
I've done this very monkey patch: # frozen_string_literal: true
return unless Rails.env == 'production'
module ActionDispatch
class Request
def ssl?
Rails.logger.info('SSL TRUE')
true
end
end
end I believe we found a nicer fix in another project but I can't remember what it is. |
@paul-mesnilgrente Do you remember which file you placed this block of code in? |
you could probably put code like that in |
I am currently using refinery 4 with rails 5.1 and the application is leaving under CloudFront -> AWS load balancers -> Nginx.
My problem is that CloudFront terminates SSL and the stack doesn't let the header
X-Fowarded-Proto: https
to come through. This has the consequence that iframes in refinery have links in http when the main page is https, browsers don't allow that and blocks the links.So I am trying to find a way to force links to be https in the iframe but I can't find a way to do it without monkey patching something. I know that the last line being called by Refinery is that one: https://github.com/refinery/refinerycms/blob/master/core/config/initializers/will_paginate_monkeypatch.rb#L16
Is there any settings I can use to force https links in production?
I already tried
Rails.application.routes.default_url_options[:protocol] = 'https'
but it didn't work. Do you know why maybe?The text was updated successfully, but these errors were encountered: