From 5eac963625686a6070bf438e998f7c3323af991a Mon Sep 17 00:00:00 2001 From: Po Chen Date: Wed, 7 Sep 2016 22:52:20 +1000 Subject: [PATCH] fix group_by_keys when there are more than 2 values that have the same key, group_by_keys misbehave and produce something like `%{list: [["a", "b"], "c"]}` --- lib/httparrot/general_request_info.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/httparrot/general_request_info.ex b/lib/httparrot/general_request_info.ex index 9e147e4..7258ef0 100644 --- a/lib/httparrot/general_request_info.ex +++ b/lib/httparrot/general_request_info.ex @@ -24,7 +24,7 @@ defmodule HTTParrot.GeneralRequestInfo do |> Enum.map(fn {k, v} -> %{k => v} end) |> Enum.reduce(fn m, acc -> Map.merge(m, acc, fn _k, v1, v2 -> - [v2, v1] + List.wrap(v2) ++ List.wrap(v1) end) end) end