happstack-server 7.8.0.2 → 7.9.0
raw patch · 3 files changed
+26/−12 lines, 3 filesdep ~networkPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: network
API changes (from Hackage documentation)
+ Happstack.Server.Cookie: [partitioned] :: Cookie -> Bool
+ Happstack.Server.Internal.Cookie: [partitioned] :: Cookie -> Bool
- Happstack.Server.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Bool -> SameSite -> Cookie
+ Happstack.Server.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Bool -> SameSite -> Bool -> Cookie
- Happstack.Server.Internal.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Bool -> SameSite -> Cookie
+ Happstack.Server.Internal.Cookie: Cookie :: String -> String -> String -> String -> String -> Bool -> Bool -> SameSite -> Bool -> Cookie
Files
- happstack-server.cabal +15/−3
- src/Happstack/Server/Internal/Cookie.hs +5/−3
- tests/Happstack/Server/Tests.hs +6/−6
happstack-server.cabal view
@@ -1,5 +1,5 @@ Name: happstack-server-Version: 7.8.0.2+Version: 7.9.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@@ -11,8 +11,20 @@ Build-Type: Simple Cabal-Version: >= 1.10 Extra-Source-Files: tests/Happstack/Server/Tests.hs README.md-tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.4, GHC==8.10.7, GHC==9.0.2, GHC==9.2.5, GHC==9.4.3 +tested-with:+ GHC == 9.8.1+ GHC == 9.6.3+ GHC == 9.4.7+ GHC == 9.2.8+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2+ source-repository head type: git location: https://github.com/Happstack/happstack-server.git@@ -85,7 +97,7 @@ sendfile >= 0.7.1 && < 0.8, system-filepath >= 0.3.1, syb,- text >= 0.10 && < 2.1,+ text >= 0.10 && < 2.2, time, threads >= 0.5, transformers >= 0.1.3 && < 0.7,
src/Happstack/Server/Internal/Cookie.hs view
@@ -46,6 +46,7 @@ , secure :: Bool , httpOnly :: Bool , sameSite :: SameSite+ , partitioned :: Bool } deriving(Show,Eq,Read,Typeable,Data) -- | Specify the lifetime of a cookie.@@ -102,13 +103,13 @@ -- | Creates a cookie with a default version of 1, empty domain, a -- path of "/", secure == False, httpOnly == False and--- sameSite == SameSiteNoValue+-- sameSite == SameSiteNoValue and partitioned = False -- -- see also: 'addCookie' mkCookie :: String -- ^ cookie name -> String -- ^ cookie value -> Cookie-mkCookie key val = Cookie "1" "/" "" key val False False SameSiteNoValue+mkCookie key val = Cookie "1" "/" "" key val False False SameSiteNoValue False -- | Set a Cookie in the Result. -- The values are escaped as per RFC 2109, but some browsers may@@ -147,6 +148,7 @@ ++ (if httpOnly cookie then ["HttpOnly"] else []) ++ (if sameSite cookie /= SameSiteNoValue then [displaySameSite . sameSite $ cookie] else [])+ ++ (if partitioned cookie then ["Partitioned"] else []) -- | Not an supported api. Takes a cookie header and returns -- either a String error message or an array of parsed cookies@@ -170,7 +172,7 @@ val<-value path<-option "" $ try (cookieSep >> cookie_path) domain<-option "" $ try (cookieSep >> cookie_domain)- return $ Cookie ver path domain (low name) val False False SameSiteNoValue+ return $ Cookie ver path domain (low name) val False False SameSiteNoValue False cookie_version = cookie_special "$Version" cookie_path = cookie_special "$Path" cookie_domain = cookie_special "$Domain"
tests/Happstack/Server/Tests.hs view
@@ -44,24 +44,24 @@ "cookieParserTest" ~: [parseCookies "$Version=1;Cookie1=value1;$Path=\"/testpath\";$Domain=example.com;cookie2=value2" @?= (Right [- Cookie "1" "/testpath" "example.com" "cookie1" "value1" False False SameSiteNoValue- , Cookie "1" "" "" "cookie2" "value2" False False SameSiteNoValue+ Cookie "1" "/testpath" "example.com" "cookie1" "value1" False False SameSiteNoValue False+ , Cookie "1" "" "" "cookie2" "value2" False False SameSiteNoValue False ]) ,parseCookies " \t $Version = \"1\" ; cookie1 = \"randomcrap!@#%^&*()-_+={}[]:;'<>,.?/\\|\" , $Path=/ " @?= (Right [- Cookie "1" "/" "" "cookie1" "randomcrap!@#%^&*()-_+={}[]:;'<>,.?/|" False False SameSiteNoValue+ Cookie "1" "/" "" "cookie1" "randomcrap!@#%^&*()-_+={}[]:;'<>,.?/|" False False SameSiteNoValue False ]) ,parseCookies " cookie1 = value1 " @?= (Right [- Cookie "" "" "" "cookie1" "value1" False False SameSiteNoValue+ Cookie "" "" "" "cookie1" "value1" False False SameSiteNoValue False ]) ,parseCookies " $Version=\"1\";buggygooglecookie = valuewith=whereitshouldnotbe " @?= (Right [- Cookie "1" "" "" "buggygooglecookie" "valuewith=whereitshouldnotbe" False False SameSiteNoValue+ Cookie "1" "" "" "buggygooglecookie" "valuewith=whereitshouldnotbe" False False SameSiteNoValue False ]) , parseCookies "foo=\"\\\"bar\\\"\"" @?= (Right [- Cookie "" "" "" "foo" "\"bar\"" False False SameSiteNoValue+ Cookie "" "" "" "foo" "\"bar\"" False False SameSiteNoValue False ]) ]