)
where
-import Data.ByteString.Char8 as C8
import Data.Maybe
import Network.HTTP.Lucu
import Network.HTTP.Lucu.Utils
handleGet env name
= do pageM <- getPage (envStorage env) name Nothing
case pageM of
- Nothing
- -> foundNoEntity Nothing
-
- Just redir@(Redirection _ _ _ _ _)
- -> handleRedirect env redir
-
- Just entity@(Entity _ _ _ _ _ _ _ _ _ _ _ _ _ _ _)
- -> handleGetEntity entity
+ Nothing -> foundNoEntity Nothing
+ Just page -> if isEntity page then
+ handleGetEntity page
+ else
+ handleRedirect env page
{-
rev -> foundEntity (strongETag $ show rev) (entityLastMod page)
setContentType (entityType page)
- setHeader (C8.pack "Content-Disposition")
- (C8.pack $ "attachment; filename=" ++ quoteStr (entityFileName' page))
outputLBS (entityContent page)