I notice merb-core has an exception defined as SwitchingProtocols
which returns a 101 status. I don't it being used anywhere. Would
something like this be appropriate for when I need to redirect from
http to https?
Currently, to handle https redirects, I have in my Application
controller:
before :require_ssl
private
def require_ssl
throw :halt, proc { redirect "https://#{request.host}#
{request.uri}" } unless request.ssl?
end
end
The above works well for me. But an https redirect is such a common
thing, should merb have an exception for it? Then you can have a well
guarded error handler like this:
def require_ssl
throw :switch_protocols, :https
end
end
thanks, Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---