wai-handler-launch 1.3.1.5 → 2.0.0
raw patch · 2 files changed
+8/−7 lines, 2 filesdep ~waidep ~warp
Dependency ranges changed: wai, warp
Files
Network/Wai/Handler/Launch.hs view
@@ -8,6 +8,7 @@ ) where import Network.Wai+import Network.Wai.Internal import Network.HTTP.Types import qualified Network.Wai.Handler.Warp as Warp import Data.IORef@@ -45,14 +46,14 @@ ResponseSource _ hs _ | not $ isHtml hs -> return res _ -> do- let (s, hs, body) = responseSource res+ let (s, hs, withBody) = responseToSource res let (isEnc, headers') = fixHeaders id hs let headers'' = filter (\(x, _) -> x /= "content-length") headers' let fixEnc src = if isEnc then src $= decompressFlush (WindowBits 31) else src- return $ ResponseSource s headers''+ return $ ResponseSource s headers'' $ \f -> withBody $ \body -> f $ fixEnc (body $= builderToByteStringFlush) $= insideHead $= CL.map (fmap fromByteString)@@ -60,7 +61,7 @@ toInsert :: S.ByteString toInsert = "<script>setInterval(function(){var x;if(window.XMLHttpRequest){x=new XMLHttpRequest();}else{x=new ActiveXObject(\"Microsoft.XMLHTTP\");}x.open(\"GET\",\"/_ping\",false);x.send();},60000)</script>" -insideHead :: Conduit (Flush S.ByteString) (ResourceT IO) (Flush S.ByteString)+insideHead :: Conduit (Flush S.ByteString) IO (Flush S.ByteString) insideHead = loop' (S.empty, whole) where@@ -139,7 +140,7 @@ x <- newIORef True _ <- forkIO $ Warp.runSettings Warp.defaultSettings { Warp.settingsPort = port- , Warp.settingsOnException = const $ return ()+ , Warp.settingsOnException = (\_ _ -> return ()) , Warp.settingsHost = "*4" } $ ping x app launch port url
wai-handler-launch.cabal view
@@ -1,5 +1,5 @@ Name: wai-handler-launch-Version: 1.3.1.5+Version: 2.0.0 Synopsis: Launch a web app in the default browser. Description: This handles cross-platform launching and inserts Javascript code to ping the server. When the server no longer receives pings, it shuts down. License: MIT@@ -13,8 +13,8 @@ Library Exposed-modules: Network.Wai.Handler.Launch build-depends: base >= 4 && < 5- , wai >= 1.3 && < 1.5- , warp >= 1.3 && < 1.4+ , wai >= 2.0 && < 2.1+ , warp >= 2.0 && < 2.1 , http-types >= 0.7 , transformers >= 0.2.2 && < 0.4 , bytestring >= 0.9.1.4