packages feed

http-reverse-proxy 0.1.0.2 → 0.1.0.3

raw patch · 2 files changed

+12/−11 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Network/HTTP/ReverseProxy.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, NoImplicitPrelude, FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings, NoImplicitPrelude, FlexibleContexts, ScopedTypeVariables #-} module Network.HTTP.ReverseProxy     ( -- * Types       ProxyDest (..)@@ -177,15 +177,16 @@     fromClient0 = DCN.appSource appdata0     toClient = DCN.appSink appdata0     loop fromClient = do-        (fromClient', keepAlive) <- runResourceT $ do-            (req, fromClient') <- parseRequest conn 0 dummyAddr fromClient-            res <- app req-            keepAlive <- sendResponse dummyCleaner req conn res-            (fromClient'', _) <- liftIO fromClient' >>= unwrapResumable-            return (fromClient'', keepAlive)-        if keepAlive-            then loop fromClient'-            else return ()+        mfromClient <- runResourceT $ do+            ex <- try $ parseRequest conn 0 dummyAddr fromClient+            case ex of+                Left (_ :: SomeException) -> return Nothing+                Right (req, fromClient') -> do+                    res <- app req+                    keepAlive <- sendResponse dummyCleaner req conn res+                    (fromClient'', _) <- liftIO fromClient' >>= unwrapResumable+                    return $ if keepAlive then Just fromClient'' else Nothing+        maybe (return ()) loop mfromClient      dummyAddr = SockAddrInet (PortNum 0) 0 -- FIXME     conn = Connection
http-reverse-proxy.cabal view
@@ -1,5 +1,5 @@ name:                http-reverse-proxy-version:             0.1.0.2+version:             0.1.0.3 synopsis:            Reverse proxy HTTP requests, either over raw sockets or with WAI description:         Provides a simple means of reverse-proxying HTTP requests. The raw approach uses the same technique as leveraged by keter, whereas the WAI approach performs full request/response parsing via WAI and http-conduit. homepage:            https://github.com/fpco/http-reverse-proxy