mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't mistakenly interpret the request uri as the query string. Closes #8731.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
3bf3042a6c
commit
9159489872
3 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Don't mistakenly interpret the request uri as the query string. #8731 [lifofifo, Jeremy Kemper]
|
||||
|
||||
* Make ActionView#view_paths an attr_accessor for real this time. Also, don't perform an unnecessary #compact on the @view_paths array in #initialize. Closes #8582 [dasil003, julik, rick]
|
||||
|
||||
* Tolerate missing content type on multipart file uploads. Fix for Safari 3. [Jeremy Kemper]
|
||||
|
|
|
@ -47,11 +47,11 @@ module ActionController #:nodoc:
|
|||
end
|
||||
|
||||
def query_string
|
||||
qs = @cgi.query_string
|
||||
qs = @cgi.query_string if @cgi.respond_to?(:query_string)
|
||||
if !qs.blank?
|
||||
qs
|
||||
elsif uri = @env['REQUEST_URI']
|
||||
uri.split('?', 2).last
|
||||
uri.split('?', 2)[1] || ''
|
||||
else
|
||||
@env['QUERY_STRING'] || ''
|
||||
end
|
||||
|
|
|
@ -67,6 +67,11 @@ class CgiRequestParamsParsingTest < BaseCgiTest
|
|||
@request.env['RAW_POST_DATA'] = data
|
||||
assert_equal({"flamenco"=> "love"}, @request.request_parameters)
|
||||
end
|
||||
|
||||
def test_doesnt_interpret_request_uri_as_query_string_when_missing
|
||||
@request.env['REQUEST_URI'] = 'foo'
|
||||
assert_equal({}, @request.query_parameters)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue