aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/request.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-09-11 14:10:20 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-09-11 14:10:20 +0000
commitc0e84b811eed956d5e2ed5d10104ca1c70f3e1c1 (patch)
treed60655a5a26e31dd968f3315032645aa39ba7728 /actionpack/lib/action_controller/request.rb
parent27962ead0380dcc3997eb45714d6334960f8cce7 (diff)
downloadrails-c0e84b811eed956d5e2ed5d10104ca1c70f3e1c1.tar.gz
rails-c0e84b811eed956d5e2ed5d10104ca1c70f3e1c1.tar.bz2
rails-c0e84b811eed956d5e2ed5d10104ca1c70f3e1c1.zip
Ensure that request.path never returns nil. Closes #1675
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2206 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-xactionpack/lib/action_controller/request.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index ca8dfff161..c3d440d815 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -158,12 +158,10 @@ module ActionController
path = (uri = request_uri) ? uri.split('?').first : ''
# Cut off the path to the installation directory if given
- if root = relative_url_root
- path[root.length..-1]
- else
- path
- end
- end
+ root = relative_url_root
+ path[0, root.length] = '' if root
+ path || ''
+ end
# Returns the path minus the web server relative installation directory.
# This method returns nil unless the web server is apache.