on master help sign in
3 files changed+11−1
since splitsnapshots
unifiedsplit
wai-extra/ChangeLog.md+4 wai-extra/Network/Wai/Test.hs+6 wai-extra/wai-extra.cabal+1−1
wai-extra/ChangeLog.md+4
@@ -1,5 +1,9 @@
11# Changelog for wai-extra
22
3+## 3.0.29.1
4+
5+* Fix `Network.Wai.Test.request` always sending an empty request body [#794](https://github.com/yesodweb/wai/pull/794)
6+
37## 3.0.29
48
59* Export `Network.Wai.EventSource.eventStreamAppRaw` [#786](https://github.com/yesodweb/wai/pull/786)
wai-extra/Network/Wai/Test.hs+6
@@ -99,6 +99,10 @@ runSession session app = ST.evalStateT (runReaderT session app) initState
9999data SRequest = SRequest
100100 { simpleRequest :: Request
101101 , simpleRequestBody :: L.ByteString
102+ -- ^ Request body that will override the one set in 'simpleRequest'.
103+ --
104+ -- This is usually simpler than setting the body as a stateful IO-action
105+ -- in 'simpleRequest'.
102106 }
103107data SResponse = SResponse
104108 { simpleStatus :: H.Status
@@ -174,6 +178,8 @@ extractSetCookieFromSResponse response = do
174178 (Map.fromList [(Cookie.setCookieName c, c) | c <- newClientCookies ]))
175179 return response
176180
181+-- | Similar to 'request', but allows setting the request body as a plain
182+-- 'L.ByteString'.
177183srequest :: SRequest -> Session SResponse
178184srequest (SRequest req bod) = do
179185 refChunks <- liftIO $ newIORef $ L.toChunks bod
wai-extra/wai-extra.cabal+1−1
@@ -1,5 +1,5 @@
11Name: wai-extra
2−Version: 3.0.29
2+Version: 3.0.29.1
33Synopsis: Provides some basic WAI handlers and middleware.
44description:
55 Provides basic WAI handler and middleware functionality: