Permalink
Browse files

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
  • Loading branch information...
1 parent 3bf3042 commit 9159489872a1dd2038888b72b6990484a24ccad8 @jeremy jeremy committed Jun 23, 2007
@@ -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 @@ def initialize(cgi, session_options = {})
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 @@ def test_doesnt_break_when_content_type_has_charset
@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

0 comments on commit 9159489

Please sign in to comment.