Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix HTTP::Params.parse("&&") bug #5274

Merged
merged 1 commit into from Nov 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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