Skip to content

Commit

Permalink
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions spec/std/http/params_spec.cr
Original file line number Diff line number Diff line change
@@ -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"]}},
4 changes: 2 additions & 2 deletions src/http/params.cr
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ module HTTP
if key
yield key.not_nil!, value
else
yield value, ""
yield value, "" unless value.empty?
end

key = nil
@@ -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

0 comments on commit c9fac56

Please sign in to comment.