packages feed

happstack-server 6.5.4 → 6.5.6

raw patch · 3 files changed

+33/−10 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Happstack.Server.RqData: lookText' :: (Functor m, Monad m, HasRqData m) => String -> m Text
+ Happstack.Server.RqData: lookTexts' :: (Functor m, Monad m, HasRqData m) => String -> m [Text]
- Happstack.Server.Internal.Compression: encodings :: GenParser Char st [([Char], Maybe Double)]
+ Happstack.Server.Internal.Compression: encodings :: GenParser Char st [(String, Maybe Double)]

Files

happstack-server.cabal view
@@ -1,5 +1,5 @@ Name:                happstack-server-Version:             6.5.4+Version:             6.5.6 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/Compression.hs view
@@ -117,8 +117,8 @@                 Just (Just a) | a>0 -> addIdent $ knownEncodings m                               | otherwise -> knownEncodings m                 Just (Nothing) -> addIdent $ knownEncodings m-        dropZero (_, Just a) | a==0 = False-                          | otherwise = True+        dropZero (_, Just a) | a==0      = False+                             | otherwise = True         dropZero (_, Nothing) = True         addIdent:: [(String,Maybe Double)] -> [(String, Maybe Double)]         addIdent m = if isNothing $ lookup "identity" m@@ -161,7 +161,7 @@     ]  -- | a parser for the Accept-Encoding header-encodings :: GenParser Char st [([Char], Maybe Double)]+encodings :: GenParser Char st [(String, Maybe Double)] encodings = ws >> (encoding1 `sepBy` try sep) >>= (\x -> ws >> eof >> return x)     where         ws :: GenParser Char st ()
src/Happstack/Server/RqData.hs view
@@ -10,7 +10,9 @@       look     , looks     , lookText+    , lookText'     , lookTexts+    , lookTexts'     , lookBS     , lookBSs     , lookRead@@ -73,8 +75,9 @@ import Data.Generics                            (Data, Typeable) import Data.Maybe                               (fromMaybe, fromJust) import Data.Monoid 				(Monoid(mempty, mappend, mconcat))-import           Data.Text.Lazy                 (Text)-import qualified Data.Text.Lazy.Encoding        as Text+import           Data.Text                      (Text)+import qualified Data.Text.Lazy                 as LazyText+import qualified Data.Text.Lazy.Encoding        as LazyText import Happstack.Server.Cookie 			(Cookie (cookieValue)) import Happstack.Server.Internal.Monads         (ServerMonad(askRq, localRq), FilterMonad, WebMonad, ServerPartT, escape) import Happstack.Server.Internal.RFC822Headers  (parseContentType)@@ -400,9 +403,19 @@ -- This function assumes the underlying octets are UTF-8 encoded. -- -- see also: 'lookTexts', 'look', 'looks', 'lookBS', and 'lookBSs'-lookText :: (Functor m, Monad m, HasRqData m) => String -> m Text-lookText = fmap Text.decodeUtf8 . lookBS+lookText :: (Functor m, Monad m, HasRqData m) => String -> m LazyText.Text+lookText = fmap LazyText.decodeUtf8 . lookBS +-- | Gets the first matching named input parameter as a strict 'Text'+--+-- Searches the QUERY_STRING followed by the Request body.+--+-- This function assumes the underlying octets are UTF-8 encoded.+--+-- see also: 'lookTexts', 'look', 'looks', 'lookBS', and 'lookBSs'+lookText' :: (Functor m, Monad m, HasRqData m) => String -> m Text+lookText' = fmap LazyText.toStrict . lookText+ -- | Gets all matches for the named input parameter as lazy 'Text's -- -- Searches the QUERY_STRING followed by the Request body.@@ -410,8 +423,18 @@ -- This function assumes the underlying octets are UTF-8 encoded. -- -- see also: 'lookText', 'looks' and 'lookBSs'-lookTexts :: (Functor m, Monad m, HasRqData m) => String -> m [Text]-lookTexts = fmap (map Text.decodeUtf8) . lookBSs+lookTexts :: (Functor m, Monad m, HasRqData m) => String -> m [LazyText.Text]+lookTexts = fmap (map LazyText.decodeUtf8) . lookBSs++-- | Gets all matches for the named input parameter as strict 'Text's+--+-- Searches the QUERY_STRING followed by the Request body.+--+-- This function assumes the underlying octets are UTF-8 encoded.+--+-- see also: 'lookText'', 'looks' and 'lookBSs'+lookTexts' :: (Functor m, Monad m, HasRqData m) => String -> m [Text]+lookTexts' = fmap (map LazyText.toStrict) . lookTexts  -- | Gets the named cookie -- the cookie name is case insensitive