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  05b453a22736ab4d79acbf09cbaac947c990c35a (commit)
      from  4e83df6378dd3e74242078bf33d99c5661a70ef2 (commit)


Summary of changes:
 src/Snap/Internal/Types.hs |    9 +++++++--
 1 files changed, 7 insertions(+), 2 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 05b453a22736ab4d79acbf09cbaac947c990c35a
Author: Gregory Collins <[email protected]>
Date:   Wed Sep 1 14:50:51 2010 -0400

    Fix the way redirects work; users now can set response headers

diff --git a/src/Snap/Internal/Types.hs b/src/Snap/Internal/Types.hs
index 90b5db7..2f5687c 100644
--- a/src/Snap/Internal/Types.hs
+++ b/src/Snap/Internal/Types.hs
@@ -385,10 +385,15 @@ redirect target = redirect' target 302
 -- '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 =
+redirect' target status = do
+    r <- getResponse
+
     finishWith
         $ setResponseCode status
-        $ setHeader "Location" target emptyResponse
+        $ setContentLength 0
+        $ modifyResponseBody (const $ enumBS "")
+        $ setHeader "Location" target r
+
 {-# INLINE redirect' #-}
 
 
-----------------------------------------------------------------------


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

Reply via email to