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, 0.5 has been created
        at  2b033c809fb6d3bb595fb06156ef649e82fed47f (commit)

- Log -----------------------------------------------------------------
commit 2b033c809fb6d3bb595fb06156ef649e82fed47f
Author: Bas van Dijk <[email protected]>
Date:   Wed Mar 9 21:12:10 2011 +0100

    Use case-insensitive instead of CIByteString

diff --git a/snap-server.cabal b/snap-server.cabal
index f4331e8..1a3e08d 100644
--- a/snap-server.cabal
+++ b/snap-server.cabal
@@ -109,6 +109,7 @@ Library
     blaze-builder-enumerator >= 0.2.0 && <0.3,
     bytestring,
     bytestring-nums,
+    case-insensitive >= 0.2 && < 0.3,
     containers,
     directory-tree,
     enumerator >= 0.4.7 && <0.5,
diff --git a/src/Snap/Internal/Http/Server.hs b/src/Snap/Internal/Http/Server.hs
index 49f0d76..7cebef1 100644
--- a/src/Snap/Internal/Http/Server.hs
+++ b/src/Snap/Internal/Http/Server.hs
@@ -15,7 +15,8 @@ import           Control.Arrow (first, second)
 import           Control.Monad.State.Strict
 import           Control.Exception
 import           Data.Char
-import           Data.CIByteString
+import           Data.CaseInsensitive   (CI)
+import qualified Data.CaseInsensitive as CI
 import           Data.ByteString (ByteString)
 import qualified Data.ByteString as S
 import qualified Data.ByteString.Char8 as SC
@@ -449,7 +450,7 @@ receiveRequest = do
 
       where
         isChunked = maybe False
-                          ((== ["chunked"]) . map toCI)
+                          ((== ["chunked"]) . map CI.mk)
                           (Map.lookup "transfer-encoding" hdrs)
 
         hasContentLength :: Int64 -> ServerMonad ()
@@ -684,7 +685,7 @@ sendResponse req rsp' buffer writeEnd' onSendFile = do
 
 
     --------------------------------------------------------------------------
-    buildHdrs :: Map CIByteString [ByteString]
+    buildHdrs :: Map (CI ByteString) [ByteString]
               -> (Builder,Int)
     buildHdrs hdrs =
         {-# SCC "buildHdrs" #-}
@@ -704,7 +705,7 @@ sendResponse req rsp' buffer writeEnd' onSendFile = do
 
         h k ys = foldl' (doOne kb klen) (mempty,0) ys
           where
-            k'      = unCI k
+            k'      = CI.original k
             kb      = fromByteString k' `mappend` fromByteString ": "
             klen    = S.length k' + 2
 
@@ -867,7 +868,7 @@ checkConnectionClose ver hdrs =
 toHeaders :: [(ByteString,ByteString)] -> Headers
 toHeaders kvps = foldl' f Map.empty kvps'
   where
-    kvps'     = map (first toCI . second (:[])) kvps
+    kvps'     = map (first CI.mk . second (:[])) kvps
     f m (k,v) = Map.insertWith' (flip (++)) k v m
 
 
diff --git a/test/runTestsAndCoverage.sh b/test/runTestsAndCoverage.sh
index 3201dd7..1c9a881 100755
--- a/test/runTestsAndCoverage.sh
+++ b/test/runTestsAndCoverage.sh
@@ -28,7 +28,6 @@ rm -Rf $DIR
 mkdir -p $DIR
 
 EXCLUDES='Main
-Data.CIByteString
 Data.Concurrent.HashMap.Internal
 Data.Concurrent.HashMap.Tests
 Paths_snap_server
-----------------------------------------------------------------------


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

Reply via email to