This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-core".
The branch, master has been updated
via 26e05da3a88a32091649ccf2d77aa2b2cdf858cc (commit)
from ef6c351c14594517dea3a5159d75af38c47700f5 (commit)
Summary of changes:
src/Snap/Util/FileServe.hs | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 26e05da3a88a32091649ccf2d77aa2b2cdf858cc
Author: Gregory Collins <[email protected]>
Date: Fri Sep 24 21:34:39 2010 -0400
Re-add setContentLength to fileServe (even though snap-server sets it for
you) to fix broken tests
diff --git a/src/Snap/Util/FileServe.hs b/src/Snap/Util/FileServe.hs
index c9b60cf..41afc2d 100644
--- a/src/Snap/Util/FileServe.hs
+++ b/src/Snap/Util/FileServe.hs
@@ -268,9 +268,12 @@ fileServeSingle' mime fp = do
then return False
else checkRangeReq req fp sz
+ dbg $ "was this a range request? " ++ Prelude.show wasRange
+
-- if we didn't have a range request, we just do normal sendfile
unless wasRange $ do
modifyResponse $ setResponseCode 200
+ . setContentLength sz
sendFile fp
where
@@ -354,6 +357,7 @@ checkRangeReq req fp sz = do
-- note: start and end INCLUSIVE here
send206 start end = do
dbg "inside send206"
+ let len = end-start+1
let crng = S.concat $
L.toChunks $
L.concat [ "bytes "
@@ -365,6 +369,7 @@ checkRangeReq req fp sz = do
modifyResponse $ setResponseCode 206
. setHeader "Content-Range" crng
+ . setContentLength len
dbg $ "send206: sending range (" ++ Prelude.show start
++ "," ++ Prelude.show (end+1) ++ ") to sendFilePartial"
-----------------------------------------------------------------------
hooks/post-receive
--
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap