happstack-server 6.1.2 → 6.1.3
raw patch · 4 files changed
+13/−8 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- happstack-server.cabal +1/−1
- src/Happstack/Server/Internal/Cookie.hs +2/−1
- src/Happstack/Server/RqData.hs +1/−1
- tests/Happstack/Server/Tests.hs +9/−5
happstack-server.cabal view
@@ -1,5 +1,5 @@ Name: happstack-server-Version: 6.1.2+Version: 6.1.3 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
@@ -146,7 +146,7 @@ -- Parsers based on RFC 2068 quoted_string = do char '"'- r <-many (oneOf qdtext)+ r <-many ((try quotedPair) <|> (oneOf qdtext)) char '"' return r @@ -160,6 +160,7 @@ octet = map chr [0..255] text = octet \\ ctl qdtext = text \\ "\""+ quotedPair = char '\\' >> anyChar -- | Get all cookies from the HTTP request. The cookies are ordered per RFC from -- the most specific to the least specific. Multiple cookies with the same
src/Happstack/Server/RqData.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses #-}+{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} -- | Functions for extracting values from the query string, form data, cookies, etc. -- -- For in-depth documentation see the following section of the Happstack Crash Course:
tests/Happstack/Server/Tests.hs view
@@ -38,21 +38,25 @@ "cookieParserTest" ~: [parseCookies "$Version=1;Cookie1=value1;$Path=\"/testpath\";$Domain=example.com;cookie2=value2" @?= (Right [- Cookie "1" "/testpath" "example.com" "cookie1" "value1" False- , Cookie "1" "" "" "cookie2" "value2" False+ Cookie "1" "/testpath" "example.com" "cookie1" "value1" False False+ , Cookie "1" "" "" "cookie2" "value2" False False ]) ,parseCookies " \t $Version = \"1\" ; cookie1 = \"randomcrap!@#%^&*()-_+={}[]:;'<>,.?/\\|\" , $Path=/ " @?= (Right [- Cookie "1" "/" "" "cookie1" "randomcrap!@#%^&*()-_+={}[]:;'<>,.?/\\|" False+ Cookie "1" "/" "" "cookie1" "randomcrap!@#%^&*()-_+={}[]:;'<>,.?/|" False False ]) ,parseCookies " cookie1 = value1 " @?= (Right [- Cookie "" "" "" "cookie1" "value1" False+ Cookie "" "" "" "cookie1" "value1" False False ]) ,parseCookies " $Version=\"1\";buggygooglecookie = valuewith=whereitshouldnotbe " @?= (Right [- Cookie "1" "" "" "buggygooglecookie" "valuewith=whereitshouldnotbe" False+ Cookie "1" "" "" "buggygooglecookie" "valuewith=whereitshouldnotbe" False False ])+ , parseCookies "foo=\"\\\"bar\\\"\""+ @?= (Right [+ Cookie "" "" "" "foo" "\"bar\"" False False+ ]) ] acceptEncodingParserTest :: Test