@@ -60,10 +60,12 @@ hpackDecodeHeader hdrblk Context{decodeDynamicTable} = do
6060
6161-- |
6262--
63+-- >>> concatCookie [("foo","bar")]
64+-- [("foo","bar")]
6365-- >>> concatCookie [("cookie","a=b"),("foo","bar"),("cookie","c=d"),("cookie","e=f")]
6466-- [("cookie","a=b; c=d; e=f"),("foo","bar")]
6567concatCookie :: HeaderList -> HeaderList
66−concatCookie hdr = ("cookie",cookieValue) : others
67− where
68− (cookies,others) = L.partition (\x -> fst x == "cookie") hdr
69− cookieValue = B.intercalate "; " (map snd cookies)
68+concatCookie hdr = case L.partition (\x -> fst x == "cookie") hdr of
69+ ([],_) -> hdr
70+ (cookies,others) -> let cookieValue = B.intercalate "; " (map snd cookies)
71+ in ("cookie",cookieValue) : others