Blankman
Blankman

Reputation: 267010

How do I know if the current request is using ssl?

How can I tell if the current request is using ssl or not?

What about if the port is other than port 80?

Upvotes: 0

Views: 68

Answers (2)

james2m
james2m

Reputation: 1580

request.ssl? will be true and request.port will give you the port the quest was on.

Upvotes: 2

preinheimer
preinheimer

Reputation: 3722

request.ssl

Should tell you

Source: http://www.rubyinside.com/19-rails-tricks-most-rails-coders-dont-know-131.html

Upvotes: 1

Related Questions