mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-23 06:42:09 +03:00
25 lines
576 B
Haskell
25 lines
576 B
Haskell
{-|
|
|
HTTP Driver
|
|
-}
|
|
|
|
module Urbit.Vere.Http where
|
|
|
|
import Urbit.Prelude
|
|
import Urbit.Arvo
|
|
|
|
import qualified Data.CaseInsensitive as CI
|
|
import qualified Network.HTTP.Types as HT
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
convertHeaders :: [HT.Header] -> [Header]
|
|
convertHeaders = fmap f
|
|
where
|
|
f (k, v) = Header (Cord $ decodeUtf8 $ CI.foldedCase k)
|
|
(MkBytes v)
|
|
|
|
unconvertHeaders :: [Header] -> [HT.Header]
|
|
unconvertHeaders = fmap f
|
|
where
|
|
f (Header (Cord k) (MkBytes v)) = (CI.mk (encodeUtf8 k), v)
|