Make HTTP Server more lenient.

This commit is contained in:
Benjamin Summers 2019-12-13 02:10:53 -08:00
parent c49e26d556
commit a1be331ac8
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ newtype ServId = ServId { unServId :: UV }
-- Http Common -----------------------------------------------------------------
data Header = Header Cord Cord
data Header = Header Cord Bytes
deriving (Eq, Ord, Show)
data ResponseHeader = ResponseHeader

View File

@ -15,9 +15,9 @@ convertHeaders :: [HT.Header] -> [Header]
convertHeaders = fmap f
where
f (k, v) = Header (Cord $ decodeUtf8 $ CI.foldedCase k)
(Cord $ decodeUtf8 v)
(MkBytes v)
unconvertHeaders :: [Header] -> [HT.Header]
unconvertHeaders = fmap f
where
f (Header (Cord k) (Cord v)) = (CI.mk (encodeUtf8 k), (encodeUtf8 v))
f (Header (Cord k) (MkBytes v)) = (CI.mk (encodeUtf8 k), v)