ghc-snap-core/snap-core-parseTime.patch

13 lines
688 B
Diff

diff -up snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs~ snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs
--- snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs~ 2001-09-09 09:46:40.000000000 +0800
+++ snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs 2023-01-26 17:11:45.155960424 +0800
@@ -1282,7 +1282,7 @@ formatLogTime ctime = do
parseHttpTime = return . toCTime . prs . S.unpack
where
prs :: String -> Maybe UTCTime
- prs = parseTime defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT"
+ prs = parseTimeM True defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT"
toCTime :: Maybe UTCTime -> CTime
toCTime (Just t) = fromInteger $ truncate $ utcTimeToPOSIXSeconds t