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  0a4b05c28f0246ae5b88c04157f359965de7a922 (commit)
      from  d9d119f04cc979ea3399e476c08a901d1be585fe (commit)


Summary of changes:
 src/Snap/Internal/Http/Types.hs |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 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 0a4b05c28f0246ae5b88c04157f359965de7a922
Author: Mighty Byte <[email protected]>
Date:   Wed Jun 9 12:22:19 2010 -0400

    Add duairc's imporovement to the Show instance for Request.

diff --git a/src/Snap/Internal/Http/Types.hs b/src/Snap/Internal/Http/Types.hs
index 2a0cb34..ca626e0 100644
--- a/src/Snap/Internal/Http/Types.hs
+++ b/src/Snap/Internal/Http/Types.hs
@@ -22,6 +22,7 @@ import qualified Data.Attoparsec as Atto
 import           Data.Attoparsec hiding (many, Result(..))
 import           Data.Bits
 import           Data.ByteString (ByteString)
+import qualified Data.ByteString.Char8 as B
 import           Data.ByteString.Internal (c2w,w2c)
 import qualified Data.ByteString.Nums.Careless.Hex as Cvt
 import qualified Data.ByteString as S
@@ -31,6 +32,7 @@ import           Data.DList (DList)
 import qualified Data.DList as DL
 import           Data.Int
 import           Data.IORef
+import           Data.List hiding (take)
 import           Data.Map (Map)
 import qualified Data.Map as Map
 import           Data.Monoid
@@ -291,7 +293,9 @@ instance Show Request where
                              ]
       beginheaders  = "Headers:\n      
========================================"
       endheaders    = "  ========================================"
-      hdrs          = "      " ++ show (rqHeaders r)
+      hdrs' (a,b)   = (B.unpack $ unCI a) ++ ": " ++ (show (map B.unpack b))
+      hdrs          = "      " ++ (concat $ intersperse "\n " $
+                                   map hdrs' (Map.toAscList $ rqHeaders r))
       contentlength = concat [ "content-length: "
                              , show $ rqContentLength r
                              ]
@@ -301,18 +305,24 @@ instance Show Request where
       version       = concat [ "version: "
                              , show $ rqVersion r
                              ]
+      cookies' = "      " ++ (concat $ intersperse "\n " $
+                              map show $ rqCookies r)
       cookies       = concat [ "cookies:\n"
                              , "      
========================================\n"
-                             , "      " ++ (show $ rqCookies r)
+                             , cookies'
                              , "\n      
========================================"
                              ]
       pathinfo      = concat [ "pathinfo: ", toStr $ rqPathInfo r ]
       contextpath   = concat [ "contextpath: ", toStr $ rqContextPath r ]
       snapletpath   = concat [ "snapletpath: ", toStr $ rqSnapletPath r ]
       uri           = concat [ "URI: ", toStr $ rqURI r ]
+      params' = "      " ++
+          (concat $ intersperse "\n " $
+           map (\ (a,b) -> B.unpack a ++ ": " ++ show b) $
+           Map.toAscList $ rqParams r)
       params        = concat [ "params:\n"
                              , "      
========================================\n"
-                             , "      " ++ (show $ rqParams r)
+                             , params'
                              , "\n      
========================================"
                              ]
 
-----------------------------------------------------------------------


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

Reply via email to