@@ -64,16 +64,8 @@ hpackDecodeHeader hdrblk Context{decodeDynamicTable} = do
6464-- [("foo","bar")]
6565-- >>> concatCookie [("cookie","a=b"),("foo","bar"),("cookie","c=d"),("cookie","e=f")]
6666-- [("cookie","a=b; c=d; e=f"),("foo","bar")]
67−-- >>> concatCookie [(":pseudo","pseudo"),("cookie","a=b"),("foo","bar"),("cookie","c=d"),("cookie","e=f")]
68−-- [(":pseudo","pseudo"),("cookie","a=b; c=d; e=f"),("foo","bar")]
6967concatCookie :: HeaderList -> HeaderList
7068concatCookie hdr = case L.partition (\x -> fst x == "cookie") hdr of
7169 ([],_) -> hdr
7270 (cookies,others) -> let cookieValue = B.intercalate "; " (map snd cookies)
73− in insertAfterPseudo ("cookie",cookieValue) others
74−
75−insertAfterPseudo :: Header -> HeaderList -> HeaderList
76−insertAfterPseudo x [] = [x]
77−insertAfterPseudo x yys@(y:ys)
78− | isPseudo (fst y) = y : insertAfterPseudo x ys
79− | otherwise = x : yys
71+ in ("cookie",cookieValue) : others