From fb14b8c6fddae818b2688ac1e584534390c37f72 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 3 Mar 2010 00:31:55 -0800 Subject: ActionDispatch::Request deprecates #request_uri * Refactored ActionPatch to use fullpath instead --- actionpack/lib/action_dispatch/http/url.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 049e1758fe..f7afbe7fed 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -3,7 +3,7 @@ module ActionDispatch module URL # Returns the complete URL used for this request. def url - protocol + host_with_port + request_uri + protocol + host_with_port + fullpath end # Returns 'https://' if this is an SSL request and 'http://' otherwise. @@ -88,15 +88,8 @@ module ActionDispatch # Returns the request URI, accounting for server idiosyncrasies. # WEBrick includes the full URL. IIS leaves REQUEST_URI blank. def request_uri - uri = "#{@env["SCRIPT_NAME"]}#{@env["PATH_INFO"]}" - uri << "?#{@env["QUERY_STRING"]}" if @env["QUERY_STRING"].present? - uri - end - - # Returns the interpreted \path to requested resource after all the installation - # directory of this application was taken into account. - def path - @env['PATH_INFO'] + ActiveSupport::Deprecation.warn "Using #request_uri is deprecated. Use fullpath instead." + fullpath end private -- cgit v1.2.3