diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-15 05:32:16 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-15 05:32:16 +0000 |
commit | e9504bb6f785a3e38788c9d787eef07d464fdd0c (patch) | |
tree | 330e207b484c27459cc78249c4c3860594f74cfb /actionpack/lib/action_controller/request.rb | |
parent | b37d7a70f9a6d9a114fb21b525fbf1eb9bfcca38 (diff) | |
download | rails-e9504bb6f785a3e38788c9d787eef07d464fdd0c.tar.gz rails-e9504bb6f785a3e38788c9d787eef07d464fdd0c.tar.bz2 rails-e9504bb6f785a3e38788c9d787eef07d464fdd0c.zip |
Cache relative_url_root for all webservers, not just Apache #2193 [skae]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2246 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index c3d440d815..00f411e7be 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -166,7 +166,7 @@ module ActionController # Returns the path minus the web server relative installation directory. # This method returns nil unless the web server is apache. def relative_url_root - @@relative_url_root ||= File.dirname(env["SCRIPT_NAME"].to_s).gsub(/(^\.$|^\/$)/, '') if server_software == 'apache' + @@relative_url_root ||= server_software == 'apache' ? File.dirname(env["SCRIPT_NAME"].to_s).gsub(/(^\.$|^\/$)/, '') : '' end # Returns the port number of this request as an integer. |