packages feed

wai-extra 0.4.0 → 0.4.0.1

raw patch · 2 files changed

+5/−3 lines, 2 files

Files

Network/Wai/Middleware/Jsonp.hs view
@@ -24,6 +24,7 @@ import Data.Monoid (mappend) import Control.Monad (join) import Data.Maybe (fromMaybe)+import qualified Data.ByteString as S  -- | Wrap json responses in a jsonp callback. --@@ -68,8 +69,9 @@             Just _ -> addCallback c $ responseEnumerator r             Nothing -> return r     checkJSON hs =-        case fmap B8.unpack $ lookup "Content-Type" hs of-            Just "application/json" -> Just $ fixHeaders hs+        case lookup "Content-Type" hs of+            Just x+                | B8.pack "application/json" `S.isPrefixOf` x -> Just $ fixHeaders hs             _ -> Nothing     fixHeaders = changeVal "Content-Type" "text/javascript"     addCallback :: B8.ByteString -> (forall a. ResponseEnumerator a)
wai-extra.cabal view
@@ -1,5 +1,5 @@ Name:                wai-extra-Version:             0.4.0+Version:             0.4.0.1 Synopsis:            Provides some basic WAI handlers and middleware. Description:         The goal here is to provide common features without many dependencies. License:             BSD3