aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-10-09 19:14:11 +0000
committerJamis Buck <jamis@37signals.com>2006-10-09 19:14:11 +0000
commit02dc646d558bf4c3ff433287d6e392dd02da22a9 (patch)
treeee67dda8e06bdebc53b4033b9d262ce8754701db /actionpack/lib
parent2c3ca4c4e6d62eb00d46bcf767d04917428f27a7 (diff)
downloadrails-02dc646d558bf4c3ff433287d6e392dd02da22a9.tar.gz
rails-02dc646d558bf4c3ff433287d6e392dd02da22a9.tar.bz2
rails-02dc646d558bf4c3ff433287d6e392dd02da22a9.zip
Fix relative URL root matching problems
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-xactionpack/lib/action_controller/request.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index 35a486fee4..505fe0777f 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -161,11 +161,10 @@ module ActionController
path = (uri = request_uri) ? uri.split('?').first : ''
# Cut off the path to the installation directory if given
- root = relative_url_root
- path[0, root.length] = '' if root
- path || ''
+ path.sub!(%r/^#{relative_url_root}/, '')
+ path || ''
end
-
+
# Returns the path minus the web server relative installation directory.
# This can be set with the environment variable RAILS_RELATIVE_URL_ROOT.
# It can be automatically extracted for Apache setups. If the server is not