aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-09-02 18:45:02 +0200
committerLoïc Hoguin <[email protected]>2013-09-02 18:45:02 +0200
commitb086ccfb7594e61c7a85241745b5329999053449 (patch)
tree8e9965944b0122c38c603c83279fa6d07a7d28d7
parentfad5c0049df278cc498b6cdb519b09e845a070a8 (diff)
downloadcowlib-b086ccfb7594e61c7a85241745b5329999053449.tar.gz
cowlib-b086ccfb7594e61c7a85241745b5329999053449.tar.bz2
cowlib-b086ccfb7594e61c7a85241745b5329999053449.zip
Replace previous special header if there's any duplicate
-rw-r--r--src/cow_spdy.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cow_spdy.erl b/src/cow_spdy.erl
index 4856afd..2dc1027 100644
--- a/src/cow_spdy.erl
+++ b/src/cow_spdy.erl
@@ -168,7 +168,8 @@ parse_headers(<< L1:32, Key:L1/binary, L2:32, Value:L2/binary, Rest/bits >>,
NbHeaders, Acc, SpAcc) ->
case Key of
<< $:, _/bits >> ->
- parse_headers(Rest, NbHeaders - 1, Acc, [{Key, Value}|SpAcc]);
+ parse_headers(Rest, NbHeaders - 1, Acc,
+ [{Key, Value}|lists:keydelete(Key, 1, SpAcc)]);
_ ->
parse_headers(Rest, NbHeaders - 1, [{Key, Value}|Acc], SpAcc)
end.