wai-app-file-cgi 0.8.5 → 0.8.6
raw patch · 5 files changed
+23/−5 lines, 5 files
Files
- Network/Wai/Application/Classic/Field.hs +15/−1
- Network/Wai/Application/Classic/File.hs +1/−1
- Network/Wai/Application/Classic/FileInfo.hs +2/−2
- Network/Wai/Application/Classic/Header.hs +4/−0
- wai-app-file-cgi.cabal +1/−1
Network/Wai/Application/Classic/Field.hs view
@@ -58,7 +58,6 @@ addVia cspec req hdr = (hVia, val) : hdr where ver = httpVersion req- showBS = BS.pack . show val = BS.concat [ showBS (httpMajor ver) , "."@@ -106,3 +105,18 @@ addDate zdater hdr = do date <- zdater return $ (hDate,date) : hdr++addContentRange :: Integer -> Integer -> Integer -> ResponseHeaders -> ResponseHeaders+addContentRange off len size hdr = (hContentRange, val) : hdr+ where+ val = BS.concat [+ "bytes "+ , showBS off+ , "-"+ , showBS (off + len - 1)+ , "/"+ , showBS size+ ]++showBS :: Show a => a -> ByteString+showBS = BS.pack . show
Network/Wai/Application/Classic/File.hs view
@@ -134,7 +134,7 @@ Full st | st == ok200 -> return $ RspSpec ok200 (BodyFile hdr sfile (Entire size)) | otherwise -> return $ RspSpec st (BodyFileNoBody hdr)- Partial skip len -> return $ RspSpec partialContent206 (BodyFile hdr sfile (Part skip len))+ Partial skip len -> return $ RspSpec partialContent206 (BodyFile (addContentRange skip len size hdr) sfile (Part skip len)) ----------------------------------------------------------------
Network/Wai/Application/Classic/FileInfo.hs view
@@ -33,8 +33,8 @@ date <- ifRange req rng <- lookupRequestField hRange req if date == mtime- then Just (Full ok200)- else range size rng+ then range size rng+ else Just (Full ok200) unconditional :: Request -> Integer -> HTTPDate -> Maybe StatusAux unconditional req size _ =
Network/Wai/Application/Classic/Header.hs view
@@ -25,6 +25,10 @@ hVia :: HeaderName hVia = "via" +-- | Look-up key for Content-Range.+hContentRange :: HeaderName+hContentRange = "content-range"+ ---------------------------------------------------------------- {-|
wai-app-file-cgi.cabal view
@@ -1,5 +1,5 @@ Name: wai-app-file-cgi-Version: 0.8.5+Version: 0.8.6 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3