1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move #query_string to AbstractRequest

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7727 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2007-10-03 16:39:18 +00:00
parent 3dc62ab8f9
commit 12d740dd57
2 changed files with 10 additions and 3 deletions

View file

@ -55,10 +55,8 @@ module ActionController #:nodoc:
qs = @cgi.query_string if @cgi.respond_to?(:query_string)
if !qs.blank?
qs
elsif uri = @env['REQUEST_URI']
uri.split('?', 2)[1] || ''
else
@env['QUERY_STRING'] || ''
super
end
end

View file

@ -205,6 +205,15 @@ module ActionController
parts[0..-(tld_length+2)]
end
# Return the query string, accounting for server idiosyncracies.
def query_string
if uri = @env['REQUEST_URI']
uri.split('?', 2)[1] || ''
else
@env['QUERY_STRING'] || ''
end
end
# Return the request URI, accounting for server idiosyncracies.
# WEBrick includes the full URL. IIS leaves REQUEST_URI blank.
def request_uri