Incomplete strict hash code
This commit is contained in:
parent
c42deb74f7
commit
cf841fb258
@ -238,6 +238,7 @@ mkStaticFiles' fp routeConName makeHash = do
|
|||||||
pack' <- [|pack|]
|
pack' <- [|pack|]
|
||||||
qs <- if makeHash
|
qs <- if makeHash
|
||||||
then do hash <- qRunIO $ base64md5File $ pathFromPieces fp (map pack f)
|
then do hash <- qRunIO $ base64md5File $ pathFromPieces fp (map pack f)
|
||||||
|
-- FIXME hash <- qRunIO . calcHash $ fp ++ '/' : intercalate "/" f
|
||||||
[|[(pack $(lift hash), mempty)]|]
|
[|[(pack $(lift hash), mempty)]|]
|
||||||
else return $ ListE []
|
else return $ ListE []
|
||||||
return
|
return
|
||||||
@ -290,3 +291,10 @@ getStaticHandler static toSubR pieces = do
|
|||||||
handler = fromMaybe notFound $ handleSite staticSite undefined route "GET"
|
handler = fromMaybe notFound $ handleSite staticSite undefined route "GET"
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
|
||||||
|
calcHash :: FilePath -> IO String
|
||||||
|
calcHash fname =
|
||||||
|
withBinaryFile fname ReadMode hashHandle
|
||||||
|
where
|
||||||
|
hashHandle h = do s <- L.hGetContents h
|
||||||
|
return $! base64md5 s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user