on master help sign in
pushing contents only if the status is 200.
commitdce703d4832606a0c879e7da914cd21f33b3bba5 authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 12 Jul 2016, 14:05 (10 years ago) parent72f3066
2 files changed+3−1
wai-http2-extra/Network/Wai/Middleware/Push/Referer.hs+2−1 wai-http2-extra/wai-http2-extra.cabal+1
wai-http2-extra/Network/Wai/Middleware/Push/Referer.hs+2−1
@@ -23,6 +23,7 @@ import Data.Word8
2323import Foreign.ForeignPtr (withForeignPtr, ForeignPtr)
2424import Foreign.Ptr (Ptr, plusPtr, minusPtr, nullPtr)
2525import Foreign.Storable (peek)
26+import Network.HTTP.Types (Status(..))
2627import Network.Wai
2728import Network.Wai.Handler.Warp
2829import Network.Wai.Internal (Response(..))
@@ -81,7 +82,7 @@ pushOnReferer func app req sendResponse = app req $ \res -> do
8182 Nothing -> case requestHeaderReferer req of
8283 Nothing -> return ()
8384 Just referer -> case res of
84− ResponseFile _ _ file Nothing -> do
85+ ResponseFile (Status 200 "OK") _ file Nothing -> do
8586 (mauth,refPath) <- parseUrl referer
8687 when (isNothing mauth
8788 || requestHeaderHost req == mauth) $ do
wai-http2-extra/wai-http2-extra.cabal+1
@@ -17,6 +17,7 @@ Library
1717 , auto-update >= 0.1.3 && < 0.2
1818 , bytestring
1919 , containers
20+ , http-types
2021 , wai
2122 , warp
2223 , word8