mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
Make HTTP Server more lenient.
This commit is contained in:
parent
c49e26d556
commit
a1be331ac8
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user