, RecordWildCards
, UnicodeSyntax
#-}
-
+{-# OPTIONS_HADDOCK prune #-}
-- |This is the Resource Monad; monadic actions to define the behavior
-- of each resources. The 'Resource' Monad is a kind of 'Prelude.IO'
-- Monad thus it implements 'Control.Monad.Trans.MonadIO' class. It is
-- >
-- > resFoo = ResourceDef {
-- > resIsGreedy = True
--- > , resGet = Just $ do requestURI ← getRequestURI
--- > resourcePath ← getResourcePath
--- > pathInfo ← getPathInfo
+-- > , resGet = Just $ do requestURI <- getRequestURI
+-- > resourcePath <- getResourcePath
+-- > pathInfo <- getPathInfo
-- > -- uriPath requestURI == "/foo/bar/baz"
-- > -- resourcePath == ["foo"]
-- > -- pathInfo == ["bar", "baz"]
method ← getMethod
when (method ≡ GET ∨ method ≡ HEAD)
- $ setHeader' "ETag" (printETag tag)
+ $ setHeader' "ETag"
+ $ A.fromAsciiBuilder
+ $ printETag tag
when (method ≡ POST)
$ abort InternalServerError []
(Just "Illegal computation of foundETag for POST request.")