Repository navigation
Conversation
Parameters in the query string of a POST were dropped. The body was the only source.
POST parameters came only from the body, so a query string on a POST was ignored. It is now included. A name that is in both places keeps the body value first.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #57.
initialize_queryreadQUERY_STRINGonly for GET and HEAD. A POST used the body alone, soPOST /path?q=2with bodybody=1producedparamsof{"body" => ["1"]}andcgi["q"]of"".The query string is now parsed for POST as well, including a multipart body. When a name is in both places, the body value stays first, so
cgi[key]is unchanged for that name.Before the change, that request had
cgi["q"] == "". After it,cgi["q"]is"2"andcgi.params["body"]is["1", "from-query"]when the query also sendsbody.ruby -Ilib test/cgi/test_cgi_core.rb: 12 tests, 95 assertions, 0 failures.