packages feed

engine-io-snap 1.0.0 → 1.0.1

raw patch · 3 files changed

+20/−7 lines, 3 filesdep ~engine-ioPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: engine-io

API changes (from Hackage documentation)

Files

Changelog.md view
@@ -1,3 +1,9 @@+## 1.0.1++* Updated for the new `ServerAPI` in `engine-io-1.1`.++* Fixed incomplete pattern matches when parsing request method.+ ## 1.0.0  * Initial release.
engine-io-snap.cabal view
@@ -1,5 +1,5 @@ name: engine-io-snap-version: 1.0.0+version: 1.0.1 license: BSD3 license-file: LICENSE author: Oliver Charles@@ -20,7 +20,7 @@     base >=4.6 && <4.8,     bytestring >= 0.9 && <0.11,     containers >=0.5 && <0.6,-    engine-io >= 1.0 && <1.1,+    engine-io >= 1.1 && <1.2,     snap-core >= 0.9 && <0.10,     unordered-containers >= 0.2 && <0.3,     websockets >=0.8 && <0.9,
src/Network/EngineIO/Snap.hs view
@@ -16,9 +16,10 @@ -- @Handler@ and @Snap@. snapAPI :: Snap.MonadSnap m => EIO.ServerAPI m snapAPI = EIO.ServerAPI-  { EIO.srvWriteBuilder = Snap.writeLBS . Builder.toLazyByteString--  , EIO.srvSetContentType = Snap.modifyResponse . Snap.setContentType+  { EIO.srvTerminateWithResponse = \code ct body -> do+      Snap.modifyResponse $ Snap.setResponseCode code . Snap.setContentType ct+      Snap.writeLBS $ Builder.toLazyByteString body+      Snap.getResponse >>= Snap.finishWith    , EIO.srvGetQueryParams =       LMap.foldlWithKey' (\m k v -> HashMap.insert k v m) HashMap.empty@@ -31,8 +32,14 @@       return $ case m of         Snap.GET -> "GET"         Snap.POST -> "POST"+        Snap.HEAD -> "HEAD"+        Snap.PUT -> "PUT"+        Snap.DELETE -> "DELETE"+        Snap.TRACE -> "TRACE"+        Snap.OPTIONS -> "OPTIONS"+        Snap.CONNECT -> "CONNECT"+        Snap.PATCH -> "PATCH"+        Snap.Method method -> method    , EIO.srvRunWebSocket = Snap.runWebSocketsSnap--  , EIO.srvSetResponseCode = Snap.modifyResponse . Snap.setResponseCode   }