diff options
author | thedarkone <thedarkone2@gmail.com> | 2010-09-27 17:37:40 +0200 |
---|---|---|
committer | thedarkone <thedarkone2@gmail.com> | 2010-09-27 17:45:59 +0200 |
commit | e12e2fb4f660da479110b35b375694bf267aedfb (patch) | |
tree | 2d8ece51ec724f8720b9fe4c7d517a9be368fd9f /actionpack/lib/action_dispatch | |
parent | 8fdb34b2373b13eee24a403a3af398cddb2a5ad0 (diff) | |
download | rails-e12e2fb4f660da479110b35b375694bf267aedfb.tar.gz rails-e12e2fb4f660da479110b35b375694bf267aedfb.tar.bz2 rails-e12e2fb4f660da479110b35b375694bf267aedfb.zip |
Cache 2 of Request's commonly called methods.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 2e39d0dbc2..3e5cd6a2f9 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -15,12 +15,12 @@ module ActionDispatch # Returns 'https://' if this is an SSL request and 'http://' otherwise. def protocol - ssl? ? 'https://' : 'http://' + @protocol ||= ssl? ? 'https://' : 'http://' end # Is this an SSL request? def ssl? - @env['HTTPS'] == 'on' || @env['HTTP_X_FORWARDED_PROTO'] == 'https' + @ssl ||= @env['HTTPS'] == 'on' || @env['HTTP_X_FORWARDED_PROTO'] == 'https' end # Returns the \host for this request, such as "example.com". |