Browse Source

Replace previous special header if there's any duplicate

Loïc Hoguin 11 years ago
parent
commit
b086ccfb75
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/cow_spdy.erl

+ 2 - 1
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.