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, 0.3 has been updated
       via  e5a17aa6dda233ef912a49e20e2f294b20c461bf (commit)
      from  5038054db9bb895b0b283f5bc3c3a93abe4eb302 (commit)


Summary of changes:
 src/Snap/Internal/Types.hs |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 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 e5a17aa6dda233ef912a49e20e2f294b20c461bf
Author: Mighty Byte <[email protected]>
Date:   Thu Aug 19 08:40:59 2010 -0400

    Added getCookie.

diff --git a/src/Snap/Internal/Types.hs b/src/Snap/Internal/Types.hs
index 1135dda..ae36235 100644
--- a/src/Snap/Internal/Types.hs
+++ b/src/Snap/Internal/Types.hs
@@ -39,7 +39,7 @@ import                       Prelude hiding (catch)
 
 ------------------------------------------------------------------------------
 import                       Snap.Internal.Http.Types
-import                       Snap.Iteratee hiding (Enumerator)
+import                       Snap.Iteratee hiding (Enumerator, filter)
 
 
 ------------------------------------------------------------------------------
@@ -671,3 +671,14 @@ getParam :: MonadSnap m
 getParam k = do
     rq <- getRequest
     return $ liftM (S.intercalate " ") $ rqParam k rq
+
+
+------------------------------------------------------------------------------
+-- | Gets the HTTP 'Cookie' with the specified name.
+getCookie :: MonadSnap m
+          => ByteString
+          -> m (Maybe Cookie)
+getCookie name = withRequest $
+    return . listToMaybe . filter (\c -> cookieName c == name) . rqCookies
+
+
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to