Tim
Tim

Reputation: 2285

ruby rails https

I have an administration namespace in Rails and it uses SslRequirement to protect the controllers that are in administration.

I also use the following in my routes:

namespace :administration, :constraints => { :protocol => secure_protocol } do

The problem is that I have certain controllers that I need to access from within the administration namespace that exist outside the administration namespace. I want these controllers to be accessible via HTTP or HTTPs but Rails seems to redirect back to HTTP.

Is it because of the routes that they are redirecting? Can I specify in the routes that they can be either HTTP or HTTPs?

Upvotes: 1

Views: 269

Answers (1)

Tim
Tim

Reputation: 2285

ok what I didn't realize is that the ssl_requirement gem is actually doing the redirection even on pages that I don't specify.

I just added the following to the controllers that I want either http or https.

ssl_allowed :all

Upvotes: 1

Related Questions