staticFiles (in Yesod.Static) does not work without OverloadedStrings (#437)
This commit is contained in:
parent
fe88be19dd
commit
992f4e7893
@ -301,7 +301,7 @@ mkStaticFilesList fp fs routeConName makeHash = do
|
|||||||
pack' <- [|pack|]
|
pack' <- [|pack|]
|
||||||
qs <- if makeHash
|
qs <- if makeHash
|
||||||
then do hash <- qRunIO $ base64md5File $ pathFromRawPieces fp f
|
then do hash <- qRunIO $ base64md5File $ pathFromRawPieces fp f
|
||||||
[|[("etag" :: Text, pack $(lift hash))]|]
|
[|[(pack "etag", pack $(lift hash))]|]
|
||||||
else return $ ListE []
|
else return $ ListE []
|
||||||
return
|
return
|
||||||
[ SigD routeName $ ConT route
|
[ SigD routeName $ ConT route
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
{-# LANGUAGE QuasiQuotes, TypeFamilies, MultiParamTypeClasses #-}
|
{-# LANGUAGE QuasiQuotes, TypeFamilies, MultiParamTypeClasses #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
import Yesod.Static
|
import Yesod.Static
|
||||||
import Yesod.Dispatch
|
import Yesod.Dispatch
|
||||||
@ -17,11 +16,9 @@ mkYesod "Sample" [parseRoutes|
|
|||||||
/static StaticR Static getStatic
|
/static StaticR Static getStatic
|
||||||
|]
|
|]
|
||||||
instance Yesod Sample where
|
instance Yesod Sample where
|
||||||
approot _ = ""
|
|
||||||
cleanPath _ = Right -- FIXME make this unnecessary perhaps
|
|
||||||
|
|
||||||
getRootR = do
|
getRootR = do
|
||||||
redirectText RedirectPermanent "static"
|
redirect "static"
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user