import qualified Data.ByteString.Lazy as Lazy (ByteString)
import qualified Data.ByteString.Lazy as L hiding (ByteString)
import Data.Char
-import Data.Digest.SHA1
+import Data.Digest.SHA2
import Data.Int
import Data.Maybe
import Data.Time
_ -> error "too many --etag options."
where
mkETagFromInput :: String
- mkETagFromInput = "SHA-1:" ++ (toHex $ hash $ L.unpack input)
+ mkETagFromInput = "SHA-1:" ++ (toHex $ toOctets $ sha256 $ L.unpack input)
toHex :: [Word8] -> String
toHex [] = ""
Library
Build-Depends:
- Crypto, base, bytestring, containers, directory, haskell-src,
- hxt, mtl, network, stm, time, unix, zlib
+ Crypto, base, bytestring, containers, dataenc, directory,
+ haskell-src, hxt, mtl, network, stm, time, unix, zlib
Exposed-Modules:
Network.HTTP.Lucu
Network.HTTP.Lucu.Abortion
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)