Skip to content

Commit

Permalink
fix HTTP::Params.parse query string "&&" (#5273)
Browse files Browse the repository at this point in the history
  • Loading branch information
akiicat authored and jhass committed Nov 12, 2017
1 parent 4b6f1c1 commit c9fac56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions spec/std/http/params_spec.cr
Expand Up @@ -6,6 +6,7 @@ module HTTP
describe ".parse" do
{
{"", {} of String => Array(String)},
{"&&", {} of String => Array(String)},
{" ", {" " => [""]}},
{"foo=bar", {"foo" => ["bar"]}},
{"foo=bar&foo=baz", {"foo" => ["bar", "baz"]}},
Expand Down
4 changes: 2 additions & 2 deletions src/http/params.cr
Expand Up @@ -58,7 +58,7 @@ module HTTP
if key
yield key.not_nil!, value
else
yield value, ""
yield value, "" unless value.empty?
end

key = nil
Expand All @@ -72,7 +72,7 @@ module HTTP
if key
yield key.not_nil!, buffer.to_s
else
yield buffer.to_s, ""
yield buffer.to_s, "" unless buffer.empty?
end
end

Expand Down

0 comments on commit c9fac56

Please sign in to comment.