packages feed

hack2-contrib 2012.12.18 → 2013.6.15

raw patch · 4 files changed

+11/−11 lines, 4 filesdep ~airdep ~data-defaultdep ~hack2

Dependency ranges changed: air, data-default, hack2

Files

hack2-contrib.cabal view
@@ -1,8 +1,8 @@ Name:                 hack2-contrib-Version:              2012.12.18+Version:              2013.6.15 Build-type:           Simple Synopsis:             Hack2 contrib-Description:          Common middlewares and utilities that helps working with Hack2+Description:          Common middlewares and utilities for Hack2 License:              BSD3 License-file:         LICENSE Author:               Jinjing Wang@@ -12,7 +12,7 @@ category:             Web homepage:             https://github.com/nfjinjing/hack2-contrib data-files:           readme.md, changelog.md-tested-with:          GHC==7.6.1+tested-with:          GHC==7.6.3  library @@ -26,12 +26,11 @@                   , filepath                   , containers                   , bytestring-                  , data-default >= 0.2+                  , data-default                   , time-                  , air >= 2011.6.19-                  , hack2 >= 2012.1.19+                  , air+                  , hack2                   , utf8-string-                  -- , ansi-wl-pprint                   , regexpr                      hs-source-dirs: src/
src/Hack2/Contrib/Middleware/File.hs view
@@ -25,7 +25,7 @@  file :: Maybe ByteString -> Middleware file root _ = \env -> do-  let path = env.path_info .as_string unescape_uri+  let path = env.path_info .as_string (unescape_uri > u2b)      if B.unpack ".." `isInfixOf` B.unpack path     then forbidden
src/Hack2/Contrib/Middleware/SimpleAccessLogger.hs view
@@ -32,8 +32,9 @@              method      = env.request_method.show_bytestring       http_status = env.hack_url_scheme.show_bytestring-      access_path = env.fullpath.as_string unescape_uri+      access_path = env.fullpath.as_string (unescape_uri > u2b)       +             fields =         [ env.remote_host         , "-"@@ -42,7 +43,6 @@         , r.status.show_bytestring         , r.headers.get _ContentLength .fromMaybe "-"         ]-     puts - fields.B.intercalate " "   return r   
src/Hack2/Contrib/Middleware/Static.hs view
@@ -17,12 +17,13 @@ import Prelude hiding ((.), (^), (>), (+)) import qualified Data.ByteString.Char8 as B import Data.ByteString.Char8 (ByteString)+import Air.Extra (u2b)  static :: Maybe ByteString -> [ByteString] -> Middleware static root urls app = \env -> do   let my_urls = if urls.null then ["/favicon.ico"] else urls -  let path = env.path_info .as_string unescape_uri+  let path = env.path_info .as_string (unescape_uri > u2b)    let can_serve = my_urls.find ( `B.isPrefixOf` path ) .isJust