Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added addCookies to RequestBuilder and Snap.Test

  • Loading branch information...
commit 5b1e2070f042d4d5fe4706fbb5a91e73c0181650 1 parent 4286072
@henrylaxen henrylaxen authored
Showing with 7 additions and 0 deletions.
  1. +6 −0 src/Snap/Internal/Test/RequestBuilder.hs
  2. +1 −0  src/Snap/Test.hs
View
6 src/Snap/Internal/Test/RequestBuilder.hs
@@ -25,6 +25,7 @@ module Snap.Internal.Test.RequestBuilder
, runHandlerM
, setContentType
, setHeader
+ , addCookies
, setHttpVersion
, setQueryString
, setQueryStringRaw
@@ -430,6 +431,11 @@ setHeader k v = rModify (H.setHeader k v)
addHeader :: (Monad m) => CI ByteString -> ByteString -> RequestBuilder m ()
addHeader k v = rModify (H.addHeader k v)
+------------------------------------------------------------------------------
+-- | Adds the given cookies to the request being built.
+addCookies :: (Monad m) => [Cookie] -> RequestBuilder m ()
+addCookies cookies = do
+ rModify $ \rq -> rq { rqCookies = rqCookies rq ++ cookies }
------------------------------------------------------------------------------
-- | Sets the request's @content-type@ to the given MIME type.
View
1  src/Snap/Test.hs
@@ -29,6 +29,7 @@ module Snap.Test
, addHeader
, setContentType
, setHeader
+ , addCookies
, setHttpVersion
, setQueryString
, setQueryStringRaw
Please sign in to comment.
Something went wrong with that request. Please try again.