packages feed

direct-fastcgi 1.0.1.1 → 1.0.3

raw patch · 2 files changed

+37/−15 lines, 2 filesdep −network-bytestringdep ~mtldep ~networkPVP ok

version bump matches the API change (PVP)

Dependencies removed: network-bytestring

Dependency ranges changed: mtl, network

API changes (from Hackage documentation)

Files

Network/FastCGI.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeSynonymInstances, DeriveDataTypeable #-}+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, DeriveDataTypeable #-} module Network.FastCGI (              -- * The monad              FastCGI,@@ -470,7 +470,8 @@             Exception.catch (runReaderT (insideRequestLoop handler) state')                             (\error -> flip runReaderT state' $ do                                fLog $ "Uncaught exception: "-                                      ++ (show (error :: Exception.SomeException)))+                                      ++ (show (error :: Exception.SomeException))+                               fCloseOutput)           return ()         OtherRecord unknownCode -> do           sendRecord $ Record {@@ -647,7 +648,12 @@             = intercalate ";" $ map printNameValuePair $ nameValuePairs cookie         printNameValuePair (name, Nothing) = name         printNameValuePair (name, Just value)-            = name ++ "=\"" ++ escape value ++ "\""+            = name ++ "=" ++ value+        {- Safari doesn't like this.+            = if isValidCookieToken value+                then name ++ "=" ++ value+                else name ++ "=\"" ++ escape value ++ "\""+         -}         escape "" = ""         escape ('\\':rest) = "\\\\" ++ escape rest         escape ('\"':rest) = "\\\"" ++ escape rest@@ -664,7 +670,7 @@                                       Just maxAge -> [("Max-Age", Just $ show maxAge)])                                 ++ (case cookiePath cookie of                                       Nothing -> []-                                      Just path -> [("Path", Just $ show path)])+                                      Just path -> [("Path", Just $ path)])                                 ++ (case cookieSecure cookie of                                       False -> []                                       True -> [("Secure", Nothing)])@@ -1632,14 +1638,18 @@  requireValidCookieName :: (MonadFastCGI m) => String -> m () requireValidCookieName name = do-  let valid = (length name > 0) && (all validCharacter name)-      validCharacter c = (ord c > 0) && (ord c < 128)-                         && (not $ elem c "()<>@,;:\\\"/[]?={} \t")-  if not valid+  if not $ isValidCookieToken name     then fThrow $ CookieNameInvalid name     else return ()  +isValidCookieToken :: String -> Bool+isValidCookieToken token =+    let validCharacter c = (ord c > 0) && (ord c < 128)+                           && (not $ elem c "()<>@,;:\\\"/[]?={} \t")+    in (length token > 0) && (all validCharacter token)++ -- | An exception originating within the FastCGI infrastructure or the web server. data FastCGIException     = ResponseHeadersAlreadySent@@ -1701,7 +1711,6 @@       responseStatus <- liftIO $ readMVar $ responseStatusMVar request       responseHeaderMap <- liftIO $ readMVar $ responseHeaderMapMVar request       responseCookieMap <- liftIO $ readMVar $ responseCookieMapMVar request-      fLog $ show responseCookieMap       let nameValuePairs = [("Status", (show responseStatus))]                            ++ (map (\key -> (fromHeader key,                                              fromJust $ Map.lookup key responseHeaderMap))@@ -1748,7 +1757,8 @@   -- | Informs the web server and the user agent that the request has completed.  As---   a side-effect, any unread input is discarded and no more can be read.  This is+--   side-effects, the response headers are sent if they have not yet been, and+--   any unread input is discarded and no more can be read.  This is --   implicitly called, if it has not already been, after the handler returns; it --   may be useful within a handler if the handler wishes to return results and then --   perform time-consuming computations before exiting.  If output has already been@@ -1756,6 +1766,7 @@ fCloseOutput :: (MonadFastCGI m) => m () fCloseOutput = do   requireOutputNotYetClosed+  sendResponseHeaders   terminateRequest  
direct-fastcgi.cabal view
@@ -1,6 +1,6 @@ name: direct-fastcgi-version: 1.0.1.1-cabal-version: >= 1.2+version: 1.0.3+cabal-version: >= 1.6 build-type: Simple license: BSD3 license-file: LICENSE@@ -24,12 +24,23 @@   of course, as a native implementation, there is no dependency on a C   library, which simplifies the install process. +  Version 1.0.3 adds support for the new version of the network package, which+  integrates what used to be a separate package, network-bytestring.  It also+  provides compatibility with (unreleased as of this writing) GHC 7.1.+  +  Version 1.0.2 fixes a bug; response headers are now sent if they have+  not already been when fCloseOutput is called explicitly.  It also removes+  spurious debug output that had been left in by mistake.++Source-Repository head+  type: darcs+  location: http://dankna.com/software/darcs/direct-fastcgi/+ Library   exposed-modules: Network.FastCGI   build-depends: base >= 4.1 && < 5,                  bytestring >= 0.9.1.4 && < 1,                  containers >= 0.3.0.0 && < 1,-                 mtl >= 1.1.0.2 && < 2,-                 network >= 2.2.1.5 && < 3,-                 network-bytestring >= 0.1.2.1 && < 1,+                 mtl >= 1.1.0.2 && < 3,+                 network >= 2.3.0.1 && < 3,                  utf8-string >= 0.3.6 && < 1