More String -> Text
This commit is contained in:
parent
35e424f241
commit
d9fb87b634
@ -167,7 +167,7 @@ newtype RepXml = RepXml Content
|
|||||||
instance HasReps RepXml where
|
instance HasReps RepXml where
|
||||||
chooseRep (RepXml c) _ = return (typeXml, c)
|
chooseRep (RepXml c) _ = return (typeXml, c)
|
||||||
|
|
||||||
type ContentType = B.ByteString
|
type ContentType = B.ByteString -- FIXME Text?
|
||||||
|
|
||||||
typeHtml :: ContentType
|
typeHtml :: ContentType
|
||||||
typeHtml = "text/html; charset=utf-8"
|
typeHtml = "text/html; charset=utf-8"
|
||||||
@ -220,13 +220,13 @@ simpleContentType :: ContentType -> ContentType
|
|||||||
simpleContentType = fst . B.breakByte 59 -- 59 == ;
|
simpleContentType = fst . B.breakByte 59 -- 59 == ;
|
||||||
|
|
||||||
-- | Format a 'UTCTime' in W3 format.
|
-- | Format a 'UTCTime' in W3 format.
|
||||||
formatW3 :: UTCTime -> String
|
formatW3 :: UTCTime -> T.Text
|
||||||
formatW3 = formatTime defaultTimeLocale "%FT%X-00:00"
|
formatW3 = T.pack . formatTime defaultTimeLocale "%FT%X-00:00"
|
||||||
|
|
||||||
-- | Format as per RFC 1123.
|
-- | Format as per RFC 1123.
|
||||||
formatRFC1123 :: UTCTime -> String
|
formatRFC1123 :: UTCTime -> T.Text
|
||||||
formatRFC1123 = formatTime defaultTimeLocale "%a, %d %b %Y %X %Z"
|
formatRFC1123 = T.pack . formatTime defaultTimeLocale "%a, %d %b %Y %X %Z"
|
||||||
|
|
||||||
-- | Format as per RFC 822.
|
-- | Format as per RFC 822.
|
||||||
formatRFC822 :: UTCTime -> String
|
formatRFC822 :: UTCTime -> T.Text
|
||||||
formatRFC822 = formatTime defaultTimeLocale "%a, %d %b %Y %H:%M:%S %z"
|
formatRFC822 = T.pack . formatTime defaultTimeLocale "%a, %d %b %Y %H:%M:%S %z"
|
||||||
|
|||||||
@ -612,7 +612,7 @@ alreadyExpired = setHeader "Expires" "Thu, 01 Jan 1970 05:05:05 GMT"
|
|||||||
|
|
||||||
-- | Set an Expires header to the given date.
|
-- | Set an Expires header to the given date.
|
||||||
expiresAt :: Monad mo => UTCTime -> GGHandler s m mo ()
|
expiresAt :: Monad mo => UTCTime -> GGHandler s m mo ()
|
||||||
expiresAt = setHeader "Expires" . S8.pack . formatRFC1123
|
expiresAt = setHeader "Expires" . encodeUtf8 . formatRFC1123
|
||||||
|
|
||||||
-- | Set a variable in the user's session.
|
-- | Set a variable in the user's session.
|
||||||
--
|
--
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user