packages feed

happstack-server 6.0.3 → 6.1.0

raw patch · 3 files changed

+12/−6 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Happstack.Server.Cookie: httpOnly :: Cookie -> Bool
+ Happstack.Server.Internal.Cookie: httpOnly :: Cookie -> Bool
- Happstack.Server.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Cookie
+ Happstack.Server.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Bool -> Cookie
- Happstack.Server.Internal.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Cookie
+ Happstack.Server.Internal.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Bool -> Cookie
- Happstack.Server.Monads: class (ServerMonad m, WebMonad Response m, FilterMonad Response m, MonadIO m, MonadPlus m, HasRqData m, Monad m, Functor m) => Happstack m
+ Happstack.Server.Monads: class (ServerMonad m, WebMonad Response m, FilterMonad Response m, MonadIO m, MonadPlus m, HasRqData m, Monad m, Functor m, Applicative m, Alternative m) => Happstack m

Files

happstack-server.cabal view
@@ -1,5 +1,5 @@ Name:                happstack-server-Version:             6.0.3+Version:             6.1.0 Synopsis:            Web related tools and services. Description:         Happstack Server provides an HTTP server and a rich set of functions for routing requests, handling query parameters, generating responses, working with cookies, serving files, and more. For in-depth documentation see the Happstack Crash Course <http://happstack.com/docs/crashcourse/index.html> License:             BSD3
src/Happstack/Server/Internal/Cookie.hs view
@@ -37,6 +37,7 @@     , cookieName    :: String     , cookieValue   :: String     , secure        :: Bool+    , httpOnly      :: Bool     } deriving(Show,Eq,Read,Typeable,Data)  -- | Specify the lifetime of a cookie.@@ -66,13 +67,14 @@           return $ Just (0, posixSecondsToUTCTime 0)  --- | Creates a cookie with a default version of 1, empty domain, a path of "/", and secure == False+-- | Creates a cookie with a default version of 1, empty domain, a+-- path of "/", secure == False and httpOnly == False -- -- see also: 'addCookie' mkCookie :: String  -- ^ cookie name          -> String  -- ^ cookie value          -> Cookie-mkCookie key val = Cookie "1" "/" "" key val False+mkCookie key val = Cookie "1" "/" "" key val False False  -- | Set a Cookie in the Result. -- The values are escaped as per RFC 2109, but some browsers may@@ -98,7 +100,9 @@         s f   = '\"' : concatMap e (f cookie) ++ "\""         e c | fctl c || c == '"' = ['\\',c]             | otherwise          = [c]-    in concat $ intersperse ";" ((cookieName cookie++"="++s cookieValue):[ (k++v) | (k,v) <- l, "" /= v ] ++ if secure cookie then ["Secure"] else [])+    in concat $ intersperse ";" ((cookieName cookie++"="++s cookieValue):[ (k++v) | (k,v) <- l, "" /= v ] ++ +                                 (if secure cookie then ["Secure"] else []) +++                                 (if httpOnly cookie then ["HttpOnly"] else []))  fctl :: Char -> Bool fctl ch = ch == chr 127 || ch <= chr 31@@ -125,7 +129,7 @@             val<-value             path<-option "" $ try (cookieSep >> cookie_path)             domain<-option "" $ try (cookieSep >> cookie_domain)-            return $ Cookie ver path domain (low name) val False+            return $ Cookie ver path domain (low name) val False False           cookie_version = cookie_special "$Version"           cookie_path = cookie_special "$Path"           cookie_domain = cookie_special "$Domain"
src/Happstack/Server/Monads.hs view
@@ -36,6 +36,7 @@     , requireM     ) where +import Control.Applicative               (Alternative, Applicative)          import Control.Monad                     (MonadPlus(mzero)) import Control.Monad.Trans               (MonadIO(..),MonadTrans(lift)) import qualified Data.ByteString.Char8   as B@@ -45,7 +46,8 @@  -- | A class alias for all the classes a standard server monad (such as 'ServerPartT') is expected to have instances for. This allows you to keep your type signatures shorter and easier to understand. class ( ServerMonad m, WebMonad Response m, FilterMonad Response m-      , MonadIO m, MonadPlus m, HasRqData m, Monad m, Functor m) => Happstack m+      , MonadIO m, MonadPlus m, HasRqData m, Monad m, Functor m+      , Applicative m, Alternative m) => Happstack m   instance (Functor m, Monad m, MonadPlus m, MonadIO m) => Happstack (ServerPartT m)