--- #prune
+{-# OPTIONS_HADDOCK prune #-}
-- |Manipulation of WWW authorization.
module Network.HTTP.Lucu.Authorization
where
import qualified Codec.Binary.Base64 as B64
+import Data.Maybe
import Network.HTTP.Lucu.Parser
import Network.HTTP.Lucu.Parser.Http
import Network.HTTP.Lucu.Utils
c == '+' ||
c == '/' ||
c == '=')
- let decoded = map (toEnum . fromEnum) (B64.decode b64)
+ let decoded = map (toEnum . fromEnum) (fromJust $ B64.decode b64)
case break (== ':') decoded of
(uid, ':' : password)
-> return (BasicAuthCredential uid password)