aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-11-24 19:46:30 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-11-24 19:46:30 +0000
commit1042de2370354ddb283eaa2a6c3a6166f7aaf0be (patch)
tree209311445c1b30df6edcdc5ef9b2bc4ffb44932d
parente0b904e74f242dea9427f9b8aa7d3a7e27e94b93 (diff)
downloadrails-1042de2370354ddb283eaa2a6c3a6166f7aaf0be.tar.gz
rails-1042de2370354ddb283eaa2a6c3a6166f7aaf0be.tar.bz2
rails-1042de2370354ddb283eaa2a6c3a6166f7aaf0be.zip
Added Request#ssl? which is shorthand for @request.protocol == "https://"
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller/request.rb4
2 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 2da77a2144..e16694068e 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*CVS*
+* Added Request#ssl? which is shorthand for @request.protocol == "https://"
+
* Added the choice to call form_tag with no arguments (resulting in a form posting to current action) [bitsweat]
* Upgraded to Builder 1.2.1
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index 1085066ea0..f54a00dd86 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -54,6 +54,10 @@ module ActionController
port == 443 ? "https://" : "http://"
end
+ def ssl?
+ protocol == "https://"
+ end
+
def path
request_uri ? request_uri.split("?").first : ""
end