on master help sign in
Add documentation for streamFile function.
commit6f1be4f6804de60636cca9fd358497a26ef483b9 authorPaavo <pparkkin@gmail.com> dateTue 23 Dec 2014, 13:21 (12 years ago) parentccfdd18
1 file changed+11
wai-extra/Network/Wai/Middleware/StreamFile.hs+11
wai-extra/Network/Wai/Middleware/StreamFile.hs+11
@@ -15,6 +15,17 @@ import Control.Monad (unless)
1515import Data.Function (fix)
1616import System.Posix
1717
18+-- |Convert ResponseFile type responses into ResponseStream type
19+--
20+-- Checks the response type, and if it's a ResponseFile, converts it
21+-- into a ResponseStream. Other response types are passed through
22+-- unchanged.
23+--
24+-- Converted responses get a Content-Length header.
25+--
26+-- Streaming a file will bypass a sendfile system call, and may be
27+-- useful to work around systems without working sendfile
28+-- implementations.
1829streamFile :: Middleware
1930streamFile app env sendResponse = app env $ \res ->
2031 case res of