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  fcf439700ac239cfac2c1f95023bb8e905ba850f (commit)
       via  c5f3d2131b71437a891843646372a8a5de058927 (commit)
       via  cbfa06bd717dcfeb32f30c4047182afb32cb7701 (commit)
       via  9bd94c33fb00b9e37aea671d72240d1a5c9a0571 (commit)
       via  555af36c8638ae1d0d6b211a77fd2f2a124940bf (commit)
       via  77ed8e74bfe52ed98c516a5f1ff4676a6476913e (commit)
       via  b184a0ada08daa086b3845c99088259b9734e573 (commit)
       via  0c857a7f3cf7c2fed3e17024b2595a355082b57f (commit)
       via  96f0488e64c1bd585031fd07394028dda3047321 (commit)
       via  e106a4c4fc13a7e4412f4c741cc2de93c85571e4 (commit)
       via  fa59ed8da0bf4ee082193fa20b22ba01367ccc16 (commit)
       via  a58a5a09a4a92726bf207f2827c7170b0578d819 (commit)
       via  0ee8437381a52f234b3ed4dcb247c8d8d63992be (commit)
       via  440456ad09c4fcb8ac79599c99bf520d073aeb15 (commit)
       via  fcb2afceea72310bd1fed352fcc523d0bccc1d9d (commit)
       via  76b2b0d1cb61d0e3aee6ee12739632d1d87952e1 (commit)
       via  78152120e3870f754d599b5893b07e6e525fa6bd (commit)
       via  e6562edceca8deeb21a0e331cc85de9ca9839f2c (commit)
       via  c0d76f6c7f9f3124f76c29d0a4d53a546dc22c14 (commit)
      from  5c1008cab5dd53204d3ead2b254ec615cec933a3 (commit)


Summary of changes:
 CONTRIBUTORS                                 |    1 +
 snap-core.cabal                              |    4 +-
 src/Snap/Internal/Debug.hs                   |    5 +-
 src/Snap/Internal/Http/Types.hs              |   62 ++++++++++-
 src/Snap/Internal/Types.hs                   |   24 ++++
 src/Snap/Iteratee.hs                         |   90 ++++++++------
 src/Snap/Types.hs                            |    3 +
 src/Snap/Util/GZip.hs                        |   23 ++--
 test/runTestsAndCoverage.sh                  |    3 +
 test/snap-core-testsuite.cabal               |    8 +-
 test/suite/Snap/Internal/Http/Types/Tests.hs |   62 +++++++++-
 test/suite/Snap/Iteratee/Tests.hs            |   14 ++-
 test/suite/Snap/Types/Tests.hs               |  164 +++++++++++++++++++++++++-
 test/suite/Snap/Util/FileServe/Tests.hs      |   29 ++++-
 test/suite/Snap/Util/GZip/Tests.hs           |  132 ++++++++++++++++++---
 15 files changed, 527 insertions(+), 97 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 fcf439700ac239cfac2c1f95023bb8e905ba850f
Merge: 5c1008c c5f3d21
Author: Gregory Collins <[email protected]>
Date:   Tue Aug 31 14:42:48 2010 -0400

    Merge branch 'master' into 0.3
    
    Conflicts:
        project_template/default/foo.cabal
        snap-core.cabal
        src/Snap/Iteratee.hs
        src/Snap/Util/GZip.hs

diff --cc snap-core.cabal
index 4696421,9497faf..10729b7
--- a/snap-core.cabal
+++ b/snap-core.cabal
@@@ -166,6 -173,47 +167,7 @@@ Librar
    else
      ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
  
 -Executable snap
 -  if flag(testsuite)
 -    cpp-options: -DDEBUG_TEST
 -    build-depends: deepseq >= 1.1 && <1.2
 -
 -  hs-source-dirs: src
 -  main-is: Snap/Starter.hs
 -
 -  other-modules: Snap.StarterTH
 -
 -  build-depends:
 -    attoparsec >= 0.8.1 && < 0.9,
 -    base >= 4 && < 5,
 -    bytestring,
 -    bytestring-nums,
 -    cereal >= 0.3 && < 0.4,
 -    containers,
 -    directory,
 -    directory-tree,
 -    dlist >= 0.5 && < 0.6,
 -    filepath,
 -    haskell98,
 -    iteratee >= 0.3.1 && <0.4,
 -    monads-fd,
 -    old-locale,
 -    old-time,
 -    template-haskell,
 -    text >= 0.7.1 && <0.8,
 -    time,
 -    transformers,
 -    unix-compat,
 -    zlib
 -
 -  ghc-prof-options: -prof -auto-all
 -
 -  if impl(ghc >= 6.12.0)
 -    ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
 -                 -fno-warn-unused-do-bind
 -  else
 -    ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
+ 
  source-repository head
    type:     git
    location: http://git.snapframework.com/snap-core.git
diff --cc src/Snap/Internal/Types.hs
index ae36235,90b5db7..54b6873
--- a/src/Snap/Internal/Types.hs
+++ b/src/Snap/Internal/Types.hs
@@@ -409,9 -369,33 +409,33 @@@ modifyResponse f = liftSnap 
  
  
  ------------------------------------------------------------------------------
+ -- | Performs a redirect by setting the @Location@ header to the given target
+ -- URL/path and the status code to 302 in the 'Response' object stored in a
+ -- 'Snap' monad. Note that the target URL is not validated in any way. 
Consider
+ -- using 'redirect\'' instead, which allows you to choose the correct status
+ -- code.
+ redirect :: ByteString -> Snap ()
+ redirect target = redirect' target 302
+ {-# INLINE redirect #-}
+ 
+ 
+ ------------------------------------------------------------------------------
+ -- | Performs a redirect by setting the @Location@ header to the given target
+ -- URL/path and the status code (should be one of 301, 302, 303 or 307) in the
+ -- 'Response' object stored in a 'Snap' monad. Note that the target URL is not
+ -- validated in any way.
+ redirect' :: ByteString -> Int -> Snap ()
+ redirect' target status =
+     finishWith
+         $ setResponseCode status
+         $ setHeader "Location" target emptyResponse
+ {-# INLINE redirect' #-}
+ 
+ 
+ ------------------------------------------------------------------------------
  -- | Log an error message in the 'Snap' monad
 -logError :: ByteString -> Snap ()
 -logError s = Snap $ gets _snapLogError >>= (\l -> liftIO $ l s)
 +logError :: MonadSnap m => ByteString -> m ()
 +logError s = liftSnap $ Snap $ gets _snapLogError >>= (\l -> liftIO $ l s)
                                         >>  return (Just $ Right ())
  {-# INLINE logError #-}
  
diff --cc src/Snap/Iteratee.hs
index 908c221,ac15c39..34e00d7
--- a/src/Snap/Iteratee.hs
+++ b/src/Snap/Iteratee.hs
@@@ -46,34 -45,33 +46,33 @@@ module Snap.Iterate
    ) where
  
  ------------------------------------------------------------------------------
- import           Control.Monad
+ import             Control.Monad
 -import             Control.Monad.CatchIO
 +import "MonadCatchIO-transformers" Control.Monad.CatchIO
- import           Data.ByteString (ByteString)
- import qualified Data.ByteString as S
- import qualified Data.ByteString.Unsafe as S
- import qualified Data.ByteString.Lazy as L
- import           Data.Int
- import           Data.IORef
- import           Data.Iteratee
- #ifdef PORTABLE
- import           Data.Iteratee.IO (enumHandle)
- #endif
- import qualified Data.Iteratee.Base.StreamChunk as SC
- import           Data.Iteratee.WrappedByteString
- import qualified Data.ListLike as LL
- import           Data.Monoid (mappend)
- import           Foreign
- import           Foreign.C.Types
- import           GHC.ForeignPtr
- import           Prelude hiding (catch,drop)
- import qualified Data.DList as D
- 
- #ifdef PORTABLE
- import           Control.Monad.Trans (liftIO)
- import           System.IO
- #else
+ import             Data.ByteString (ByteString)
+ import qualified   Data.ByteString as S
+ import qualified   Data.ByteString.Unsafe as S
+ import qualified   Data.ByteString.Lazy as L
+ import qualified   Data.DList as D
+ import             Data.Int
+ import             Data.IORef
+ import             Data.Iteratee
+ import             Data.Iteratee.IO (enumHandle)
+ import qualified   Data.Iteratee.Base.StreamChunk as SC
+ import             Data.Iteratee.WrappedByteString
+ import qualified   Data.ListLike as LL
+ import             Data.Monoid (mappend)
+ import             Foreign
+ import             Foreign.C.Types
+ import             GHC.ForeignPtr
+ import             Prelude hiding (catch,drop)
+ import             System.IO
+ import "monads-fd" Control.Monad.Trans (liftIO)
+ 
+ #ifndef PORTABLE
  import           Control.Exception (SomeException)
  import           System.IO.Posix.MMap
+ import           System.PosixCompat.Files
+ import           System.Posix.Types
  #endif
  
  ------------------------------------------------------------------------------
diff --cc src/Snap/Types.hs
index 211758b,9314a14..365787c
--- a/src/Snap/Types.hs
+++ b/src/Snap/Types.hs
@@@ -91,9 -90,10 +92,11 @@@ module Snap.Type
    , rspStatusReason
    , setContentType
    , addCookie
 +  , getCookie
    , setContentLength
    , clearContentLength
+   , redirect
+   , redirect'
  
      -- *** Response I/O
    , setResponseBody
diff --cc src/Snap/Util/GZip.hs
index ec14c44,f0c6d4b..f8a82ce
--- a/src/Snap/Util/GZip.hs
+++ b/src/Snap/Util/GZip.hs
@@@ -138,19 -137,19 +138,19 @@@ compressibleMimeTypes = Set.fromList [ 
  
  
  ------------------------------------------------------------------------------
- gzipCompression :: MonadSnap m => m ()
- gzipCompression = modifyResponse f
 -gzipCompression :: ByteString -> Snap ()
++gzipCompression :: MonadSnap m => ByteString -> m ()
+ gzipCompression ce = modifyResponse f
    where
-     f = setHeader "Content-Encoding" "gzip" .
+     f = setHeader "Content-Encoding" ce .
          clearContentLength .
          modifyResponseBody gcompress
  
  
  ------------------------------------------------------------------------------
- compressCompression :: MonadSnap m => m ()
- compressCompression = modifyResponse f
 -compressCompression :: ByteString -> Snap ()
++compressCompression :: MonadSnap m => ByteString -> m ()
+ compressCompression ce = modifyResponse f
    where
-     f = setHeader "Content-Encoding" "compress" .
+     f = setHeader "Content-Encoding" ce .
          clearContentLength .
          modifyResponseBody ccompress
  
-----------------------------------------------------------------------


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

Reply via email to