packages feed

rest-wai 0.1.0.0 → 0.1.0.1

raw patch · 2 files changed

+12/−5 lines, 2 filesdep ~waiPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: wai

API changes (from Hackage documentation)

Files

rest-wai.cabal view
@@ -1,5 +1,5 @@ name:                rest-wai-version:             0.1.0.0+version:             0.1.0.1 description:         Rest driver for WAI applications. synopsis:            Rest driver for WAI applications. maintainer:          code@silk.co@@ -34,5 +34,5 @@     , text                 == 1.1.*     , unordered-containers == 0.2.*     , utf8-string          == 0.3.*-    , wai                  == 2.1.*+    , wai                  >= 2.1 && < 3.1 
src/Rest/Driver/Wai.hs view
@@ -1,5 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}-{-# LANGUAGE GeneralizedNewtypeDeriving, OverloadedStrings, RankNTypes #-}+{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, OverloadedStrings, RankNTypes #-} module Rest.Driver.Wai (apiToApplication) where  import Control.Applicative@@ -25,9 +25,16 @@  apiToApplication :: Run m IO -> Api m -> Application apiToApplication run api req =+#if MIN_VERSION_wai(3,0,0)+  \cont ->   do ri <- toRestInput req      (bs, ro) <- runRestM ri (Rest.apiToHandler' (lift . run) api)-     return (fromRestOutput ro bs)+     cont (fromRestOutput ro bs)+#else+  do ri <- toRestInput req+     (bs, ro) <- runRestM ri (Rest.apiToHandler' (lift . run) api)+     return $ fromRestOutput ro bs+#endif  toRestInput :: Request -> IO RestInput toRestInput req =@@ -52,7 +59,7 @@                         "DELETE" -> Rest.DELETE                         other    -> Rest.Unknown (string other) -       , paths      = text <$> pathInfo req+       , paths      = text <$> filter (not . Text.null) (pathInfo req)         , mimeTypes  = HashMap.fromList                     . fmap (text *** string)