commit ghc-cookie for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-cookie for openSUSE:Factory checked in at 2016-04-30 23:30:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-cookie (Old) and /work/SRC/openSUSE:Factory/.ghc-cookie.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-cookie" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-cookie/ghc-cookie.changes 2015-06-30 10:19:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-cookie.new/ghc-cookie.changes 2016-04-30 23:30:16.000000000 +0200 @@ -1,0 +2,6 @@ +Tue Apr 26 08:12:25 UTC 2016 - mimi.vx@gmail.com + +- update to 0.4.2 +* Added SameSite + +------------------------------------------------------------------- Old: ---- cookie-0.4.1.6.tar.gz New: ---- cookie-0.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-cookie.spec ++++++ --- /var/tmp/diff_new_pack.IgegJH/_old 2016-04-30 23:30:16.000000000 +0200 +++ /var/tmp/diff_new_pack.IgegJH/_new 2016-04-30 23:30:16.000000000 +0200 @@ -19,7 +19,7 @@ %global pkg_name cookie Name: ghc-cookie -Version: 0.4.1.6 +Version: 0.4.2 Release: 0 Summary: HTTP cookie parsing and rendering License: BSD-2-Clause @@ -77,5 +77,6 @@ %files devel -f %{name}-devel.files %defattr(-,root,root,-) +%doc README.md ChangeLog.md %changelog ++++++ cookie-0.4.1.6.tar.gz -> cookie-0.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/ChangeLog.md new/cookie-0.4.2/ChangeLog.md --- old/cookie-0.4.1.6/ChangeLog.md 1970-01-01 01:00:00.000000000 +0100 +++ new/cookie-0.4.2/ChangeLog.md 2016-04-20 07:22:10.000000000 +0200 @@ -0,0 +1,3 @@ +## 0.4.2 + +* Added SameSite [#13](https://github.com/snoyberg/cookie/pull/13) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/README.md new/cookie-0.4.2/README.md --- old/cookie-0.4.1.6/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/cookie-0.4.2/README.md 2016-04-20 07:22:10.000000000 +0200 @@ -0,0 +1,5 @@ +## cookie + +[![Build Status](https://travis-ci.org/snoyberg/cookie.svg?branch=master)](https://travis-ci.org/snoyberg/cookie) + +HTTP cookie parsing and rendering diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/Web/Cookie.hs new/cookie-0.4.2/Web/Cookie.hs --- old/cookie-0.4.1.6/Web/Cookie.hs 2015-06-23 10:20:33.000000000 +0200 +++ new/cookie-0.4.2/Web/Cookie.hs 2016-04-20 07:22:10.000000000 +0200 @@ -12,6 +12,10 @@ , setCookieDomain , setCookieHttpOnly , setCookieSecure + , setCookieSameSite + , SameSiteOption + , sameSiteLax + , sameSiteStrict -- ** Functions , parseSetCookie , renderSetCookie @@ -100,7 +104,7 @@ `mappend` fromByteString v -- | Data type representing the key-value pair to use for a cookie, as well as configuration options for it. -- --- ==== Creating a SetCookie +-- ==== Creating a SetCookie -- -- 'SetCookie' does not export a constructor; instead, use the 'Default' instance to create one and override values (see <http://www.yesodweb.com/book/settings-types> for details): -- @@ -122,11 +126,24 @@ , setCookieDomain :: Maybe S.ByteString -- ^ The domain for which the cookie should be sent. Default value: @Nothing@ (The browser defaults to the current domain). , setCookieHttpOnly :: Bool -- ^ Marks the cookie as "HTTP only", i.e. not accessible from Javascript. Default value: @False@ , setCookieSecure :: Bool -- ^ Instructs the browser to only send the cookie over HTTPS. Default value: @False@ + , setCookieSameSite :: Maybe SameSiteOption -- ^ Marks the cookie as "same site", i.e. should not be sent with cross-site requests. Default value: @Nothing@ } deriving (Eq, Show) +-- | Data type representing the options for a SameSite cookie +data SameSiteOption = Lax | Strict deriving (Show, Eq) + +instance NFData SameSiteOption where + rnf x = x `seq` () + +sameSiteLax :: SameSiteOption +sameSiteLax = Lax + +sameSiteStrict :: SameSiteOption +sameSiteStrict = Strict + instance NFData SetCookie where - rnf (SetCookie a b c d e f g h) = + rnf (SetCookie a b c d e f g h i) = a `seq` b `seq` rnfMBS c `seq` @@ -134,7 +151,8 @@ rnf e `seq` rnfMBS f `seq` rnf g `seq` - rnf h + rnf h `seq` + rnf i where -- For backwards compatibility rnfMBS Nothing = () @@ -150,6 +168,7 @@ , setCookieDomain = Nothing , setCookieHttpOnly = False , setCookieSecure = False + , setCookieSameSite = Nothing } renderSetCookie :: SetCookie -> Builder @@ -179,6 +198,10 @@ , if setCookieSecure sc then copyByteString "; Secure" else mempty + , case setCookieSameSite sc of + Nothing -> mempty + Just Lax -> copyByteString "; SameSite=Lax" + Just Strict -> copyByteString "; SameSite=Strict" ] parseSetCookie :: S.ByteString -> SetCookie @@ -193,6 +216,10 @@ , setCookieDomain = lookup "domain" flags , setCookieHttpOnly = isJust $ lookup "httponly" flags , setCookieSecure = isJust $ lookup "secure" flags + , setCookieSameSite = case lookup "samesite" flags of + Just "Lax" -> Just Lax + Just "Strict" -> Just Strict + _ -> Nothing } where pairs = map (parsePair . dropSpace) $ S.split 59 a ++ [S8.empty] -- 59 = semicolon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/cookie.cabal new/cookie-0.4.2/cookie.cabal --- old/cookie-0.4.1.6/cookie.cabal 2015-06-23 10:20:33.000000000 +0200 +++ new/cookie-0.4.2/cookie.cabal 2016-04-20 07:22:10.000000000 +0200 @@ -1,15 +1,17 @@ name: cookie -version: 0.4.1.6 +version: 0.4.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com> maintainer: Michael Snoyman <michael@snoyman.com> synopsis: HTTP cookie parsing and rendering +description: Hackage documentation generation is not reliable. For up to date documentation, please see: <https://www.stackage.org/package/cookie>. category: Web, Yesod stability: Stable cabal-version: >= 1.8 build-type: Simple homepage: http://github.com/snoyberg/cookie +extra-source-files: README.md ChangeLog.md library build-depends: base >= 4 && < 5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cookie-0.4.1.6/test/Spec.hs new/cookie-0.4.2/test/Spec.hs --- old/cookie-0.4.1.6/test/Spec.hs 2015-06-23 10:20:33.000000000 +0200 +++ new/cookie-0.4.2/test/Spec.hs 2016-04-20 07:22:10.000000000 +0200 @@ -52,6 +52,9 @@ showList = (++) . show . concatMap show instance Arbitrary Char' where arbitrary = fmap (Char' . toEnum) $ choose (62, 125) +newtype SameSiteOption' = SameSiteOption' { unSameSiteOption' :: SameSiteOption } +instance Arbitrary SameSiteOption' where + arbitrary = fmap SameSiteOption' (elements [sameSiteLax, sameSiteStrict]) propParseRenderSetCookie :: SetCookie -> Bool propParseRenderSetCookie sc = @@ -67,6 +70,7 @@ domain <- fmap (fmap fromUnChars) arbitrary httponly <- arbitrary secure <- arbitrary + sameSite <- fmap (fmap unSameSiteOption') arbitrary return def { setCookieName = name , setCookieValue = value @@ -75,6 +79,7 @@ , setCookieDomain = domain , setCookieHttpOnly = httponly , setCookieSecure = secure + , setCookieSameSite = sameSite } caseParseCookies :: Assertion
participants (1)
-
root@hilbert.suse.de