packages feed

happstack-server 7.1.0 → 7.1.1

raw patch · 2 files changed

+8/−6 lines, 2 filesdep +time-compatdep ~directoryPVP ok

version bump matches the API change (PVP)

Dependencies added: time-compat

Dependency ranges changed: directory

API changes (from Hackage documentation)

Files

happstack-server.cabal view
@@ -1,5 +1,5 @@ Name:                happstack-server-Version:             7.1.0+Version:             7.1.1 Synopsis:            Web related tools and services. Description:         Happstack Server provides an HTTP server and a rich set of functions for routing requests, handling query parameters, generating responses, working with cookies, serving files, and more. For in-depth documentation see the Happstack Crash Course <http://happstack.com/docs/crashcourse/index.html> License:             BSD3@@ -72,7 +72,7 @@                        blaze-html        == 0.5.*,                        bytestring,                        containers,-                       directory >= 1.2,+                       directory,                        extensible-exceptions,                        filepath,                        hslogger >= 1.0.2,@@ -87,6 +87,7 @@                        syb,                        text >= 0.10 && < 0.12,                        time,+                       time-compat,                        threads >= 0.5,                        transformers >= 0.1.3 && < 0.4,                        transformers-base >= 0.4 && < 0.5,
src/Happstack/Server/FileServe/BuildingBlocks.hs view
@@ -66,6 +66,7 @@ import           Data.Map           (Map) import qualified Data.Map           as Map import Data.Time                    (UTCTime, formatTime)+import Data.Time.Compat             (toUTCTime) import Filesystem.Path.CurrentOS    (commonPrefix, encodeString, decodeString, collapse, append) import Happstack.Server.Monads      (ServerMonad(askRq), FilterMonad, WebMonad) import Happstack.Server.Response    (ToMessage(toResponse), ifModifiedSince, forbidden, ok, seeOther)@@ -214,7 +215,7 @@     do count   <- liftIO $ withBinaryFile fp ReadMode hFileSize -- garbage collection should close this        modtime <- liftIO $ getModificationTime fp        rq      <- askRq-       return $ sendFileResponse contentType fp (Just (modtime, rq)) 0 count+       return $ sendFileResponse contentType fp (Just (toUTCTime modtime, rq)) 0 count  -- | Send the specified file with the specified mime-type using lazy ByteStrings --@@ -231,7 +232,7 @@        modtime  <- liftIO $ getModificationTime fp        count    <- liftIO $ hFileSize handle        rq       <- askRq-       return $ lazyByteStringResponse contentType contents (Just (modtime, rq)) 0 count+       return $ lazyByteStringResponse contentType contents (Just (toUTCTime modtime, rq)) 0 count  -- | Send the specified file with the specified mime-type using strict ByteStrings --@@ -247,7 +248,7 @@        modtime  <- liftIO $ getModificationTime fp        count    <- liftIO $ withBinaryFile fp ReadMode hFileSize        rq       <- askRq-       return $ strictByteStringResponse contentType contents (Just (modtime, rq)) 0 count+       return $ strictByteStringResponse contentType contents (Just (toUTCTime modtime, rq)) 0 count  -- * High-level functions for serving files @@ -609,7 +610,7 @@             -> IO (FilePath, Maybe UTCTime, Maybe Integer, EntryKind) getMetaData localPath fp =      do let localFp = localPath </> fp-        modTime <- (Just <$> getModificationTime localFp) `catch`+        modTime <- (Just . toUTCTime <$> getModificationTime localFp) `catch`                    (\(_ :: IOException) -> return Nothing)         count <- do de <- doesDirectoryExist localFp                     if de