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-server".
The branch, master has been updated
via db7a6b470b40fc40f5edd0f262af5bd97a3add5a (commit)
from ff9db5e3e33ca74661b22edab5be5e3b265f5144 (commit)
Summary of changes:
snap-server.cabal | 6 +++---
src/Snap/Internal/Http/Server.hs | 7 ++++---
test/snap-server-testsuite.cabal | 4 ++--
test/suite/Snap/Internal/Http/Server/Tests.hs | 11 ++++++++---
4 files changed, 17 insertions(+), 11 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 db7a6b470b40fc40f5edd0f262af5bd97a3add5a
Author: Gregory Collins <[email protected]>
Date: Thu Jul 8 18:58:50 2010 -0400
Leave raw POST body for application/x-www-form-urlencoded input
diff --git a/snap-server.cabal b/snap-server.cabal
index 36e14d6..e7aeb8f 100644
--- a/snap-server.cabal
+++ b/snap-server.cabal
@@ -1,5 +1,5 @@
name: snap-server
-version: 0.2.7.2
+version: 0.2.8
synopsis: A fast, iteratee-based, epoll-enabled web server for the Snap
Framework
description:
This is the first developer prerelease of the Snap framework. Snap is a
@@ -117,7 +117,7 @@ Library
murmur-hash >= 0.1 && < 0.2,
network == 2.2.1.*,
old-locale,
- snap-core >= 0.2.7 && <0.3,
+ snap-core >= 0.2.8 && <0.2.9,
time,
transformers,
unix-compat,
@@ -129,7 +129,7 @@ Library
build-depends: unix
if flag(libev)
- build-depends: hlibev >= 0.2.3
+ build-depends: hlibev >= 0.2.5 && < 0.3
other-modules: Snap.Internal.Http.Server.LibevBackend
cpp-options: -DLIBEV
else
diff --git a/src/Snap/Internal/Http/Server.hs b/src/Snap/Internal/Http/Server.hs
index e32f613..d9ac38f 100644
--- a/src/Snap/Internal/Http/Server.hs
+++ b/src/Snap/Internal/Http/Server.hs
@@ -20,6 +20,7 @@ import Data.ByteString.Internal (c2w, w2c)
import qualified Data.ByteString.Nums.Careless.Int as Cvt
import Data.Int
import Data.IORef
+import Data.Iteratee.WrappedByteString (unWrap)
import Data.List (foldl')
import qualified Data.Map as Map
import Data.Maybe (fromJust, catMaybes, fromMaybe)
@@ -428,10 +429,10 @@ receiveRequest = do
let (SomeEnumerator enum) = senum
let i = joinI $ takeNoMoreThan maximumPOSTBodySize stream2stream
iter <- liftIO $ enum i
- body <- lift iter
- let newParams = parseUrlEncoded $ strictize $ fromWrap body
+ body <- liftM unWrap $ lift iter
+ let newParams = parseUrlEncoded body
liftIO $ writeIORef (rqBody req)
- (SomeEnumerator $ return . I.joinI . I.take 0)
+ (SomeEnumerator $ enumBS body)
return $ req { rqParams = rqParams req `mappend` newParams }
diff --git a/test/snap-server-testsuite.cabal b/test/snap-server-testsuite.cabal
index 97400a9..7ba4e5d 100644
--- a/test/snap-server-testsuite.cabal
+++ b/test/snap-server-testsuite.cabal
@@ -52,7 +52,7 @@ Executable testsuite
build-depends: unix
if flag(libev)
- build-depends: hlibev >= 0.2.1
+ build-depends: hlibev >= 0.2.5 && < 0.3
other-modules: Snap.Internal.Http.Server.LibevBackend
cpp-options: -DLIBEV
else
@@ -107,7 +107,7 @@ Executable pongserver
build-depends: unix
if flag(libev)
- build-depends: hlibev >= 0.2.1
+ build-depends: hlibev >= 0.2.5 && < 0.3
other-modules: Snap.Internal.Http.Server.LibevBackend
cpp-options: -DLIBEV
else
diff --git a/test/suite/Snap/Internal/Http/Server/Tests.hs
b/test/suite/Snap/Internal/Http/Server/Tests.hs
index 67c190e..eee73ae 100644
--- a/test/suite/Snap/Internal/Http/Server/Tests.hs
+++ b/test/suite/Snap/Internal/Http/Server/Tests.hs
@@ -266,10 +266,13 @@ testHttpRequest3 =
(rqParam "postparam2" req)
(Just ["2"])
- -- if we're www-form-encoded then we will have read the body already
- assertEqual "parse body" "" body
+ -- make sure the post body is still emitted
+ assertEqual "parse body" (LC.fromChunks [samplePostBody3]) body
+samplePostBody3 :: ByteString
+samplePostBody3 = "postparam1=1&postparam2=2"
+
sampleRequest3 :: ByteString
sampleRequest3 =
S.concat [ "\r\nGET /foo/bar.html?param1=abc¶m2=def%20+¶m1=abc
HTTP/1.1\r\n"
@@ -279,7 +282,9 @@ sampleRequest3 =
, "Multiheader: 2\r\n"
, "X-Random-Other-Header: foo\r\n bar\r\n"
, "\r\n"
- , "postparam1=1&postparam2=2" ]
+ , samplePostBody3 ]
+
+
rsm :: ServerMonad a -> Iteratee IO a
-----------------------------------------------------------------------
hooks/post-receive
--
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap