cookie 0.4.5 → 0.4.6
raw patch · 3 files changed
+24/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Web.Cookie: renderCookiesBS :: Cookies -> ByteString
+ Web.Cookie: renderSetCookieBS :: SetCookie -> ByteString
Files
- ChangeLog.md +5/−0
- Web/Cookie.hs +15/−1
- cookie.cabal +4/−2
ChangeLog.md view
@@ -1,3 +1,8 @@+## 0.4.6++* Resolve redundant import of Data.Monoid [#26](https://github.com/snoyberg/cookie/pull/26)+* Added `renderSetCookieBS` and `renderCookiesBS`+ ## 0.4.5 * Added `SameSite=None`
Web/Cookie.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Web.Cookie ( -- * Server to client@@ -19,12 +20,14 @@ -- ** Functions , parseSetCookie , renderSetCookie+ , renderSetCookieBS , defaultSetCookie , def -- * Client to server , Cookies , parseCookies , renderCookies+ , renderCookiesBS -- ** UTF8 Version , CookiesText , parseCookiesText@@ -37,10 +40,13 @@ import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8+import qualified Data.ByteString.Lazy as L import Data.Char (toLower, isDigit)-import Data.ByteString.Builder (Builder, byteString, char8)+import Data.ByteString.Builder (Builder, byteString, char8, toLazyByteString) import Data.ByteString.Builder.Extra (byteStringCopy)+#if !(MIN_VERSION_base(4,8,0)) import Data.Monoid (mempty, mappend, mconcat)+#endif import Data.Word (Word8) import Data.Ratio (numerator, denominator) import Data.Time (UTCTime (UTCTime), toGregorian, fromGregorian, formatTime, parseTimeM, defaultTimeLocale)@@ -101,6 +107,10 @@ renderCookies :: Cookies -> Builder renderCookies = renderCookiesBuilder . map (byteString *** byteString) +-- | @since 0.4.6+renderCookiesBS :: Cookies -> S.ByteString+renderCookiesBS = L.toStrict . toLazyByteString . renderCookies+ -- | Data type representing the key-value pair to use for a cookie, as well as configuration options for it. -- -- ==== Creating a SetCookie@@ -222,6 +232,10 @@ Just Strict -> byteStringCopy "; SameSite=Strict" Just None -> byteStringCopy "; SameSite=None" ]++-- | @since 0.4.6+renderSetCookieBS :: SetCookie -> S.ByteString+renderSetCookieBS = L.toStrict . toLazyByteString . renderSetCookie parseSetCookie :: S.ByteString -> SetCookie parseSetCookie a = SetCookie
cookie.cabal view
@@ -1,5 +1,5 @@ name: cookie-version: 0.4.5+version: 0.4.6 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -8,12 +8,13 @@ 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+cabal-version: >= 1.10 build-type: Simple homepage: http://github.com/snoyberg/cookie extra-source-files: README.md ChangeLog.md library+ default-language: Haskell2010 build-depends: base >= 4 && < 5 , bytestring >= 0.10.2 , time >= 1.5@@ -24,6 +25,7 @@ ghc-options: -Wall test-suite test+ default-language: Haskell2010 hs-source-dirs: test main-is: Spec.hs type: exitcode-stdio-1.0