on master help sign in
Use Integer for file size #524
commitb0fa55373694beb83b742a52a2ba3cd430e6e8f3 authorMichael Snoyman <michael@snoyman.com> dateTue 22 Mar 2016, 11:35 (11 years ago) parentf7458f6
2 files changed+3−3
wai-app-static/WaiAppStatic/Storage/Embedded/Runtime.hs+2−2 wai-app-static/WaiAppStatic/Types.hs+1−1
wai-app-static/WaiAppStatic/Storage/Embedded/Runtime.hs+2−2
@@ -49,7 +49,7 @@ embeddedLookup root pieces =
4949toEntry :: (Piece, EmbeddedEntry) -> Either FolderName File
5050toEntry (name, EEFolder{}) = Left name
5151toEntry (name, EEFile bs) = Right File
52− { fileGetSize = S.length bs
52+ { fileGetSize = fromIntegral $ S.length bs
5353 , fileToResponse = \s h -> W.responseBuilder s h $ fromByteString bs
5454 , fileName = name
5555 , fileGetHash = return $ Just $ runHash bs
@@ -86,7 +86,7 @@ toEmbedded fps =
8686
8787bsToFile :: Piece -> ByteString -> File
8888bsToFile name bs = File
89− { fileGetSize = S.length bs
89+ { fileGetSize = fromIntegral $ S.length bs
9090 , fileToResponse = \s h -> W.responseBuilder s h $ fromByteString bs
9191 , fileName = name
9292 , fileGetHash = return $ Just $ runHash bs
wai-app-static/WaiAppStatic/Types.hs+1−1
@@ -79,7 +79,7 @@ data Folder = Folder
7979-- | Information on an individual file.
8080data File = File
8181 { -- | Size of file in bytes
82− fileGetSize :: Int
82+ fileGetSize :: Integer
8383 -- | How to construct a WAI response for this file. Some files are stored
8484 -- on the filesystem and can use @ResponseFile@, while others are stored
8585 -- in memory and should use @ResponseBuilder@.