HTTP 4000.2.15 → 4000.2.16
raw patch · 18 files changed
+87/−47 lines, 18 filesdep ~HUnitdep ~basedep ~bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: HUnit, base, bytestring, case-insensitive, conduit, deepseq, http-types, httpd-shed, mtl, network, pureMD5, split, test-framework, test-framework-hunit, wai, warp
API changes (from Hackage documentation)
Files
- HTTP.cabal +44/−25
- Network/Browser.hs +1/−1
- Network/BufferType.hs +1/−1
- Network/HTTP.hs +1/−1
- Network/HTTP/Auth.hs +1/−1
- Network/HTTP/Base.hs +1/−1
- Network/HTTP/Cookie.hs +1/−1
- Network/HTTP/HandleStream.hs +1/−1
- Network/HTTP/Headers.hs +1/−1
- Network/HTTP/Proxy.hs +9/−1
- Network/HTTP/Stream.hs +1/−1
- Network/HTTP/Utils.hs +1/−1
- Network/Stream.hs +1/−1
- Network/StreamDebugger.hs +1/−1
- Network/StreamSocket.hs +1/−1
- Network/TCP.hs +1/−1
- test/Httpd.hs +12/−4
- test/httpTests.hs +8/−3
HTTP.cabal view
@@ -1,11 +1,11 @@ Name: HTTP-Version: 4000.2.15+Version: 4000.2.16 Cabal-Version: >= 1.8 Build-type: Simple License: BSD3 License-file: LICENSE Author: Warrick Gray <warrick.gray@hotmail.com>-Maintainer: Ganesh Sittampalam <http@projects.haskell.org>+Maintainer: Ganesh Sittampalam <ganesh@earth.li> Homepage: https://github.com/haskell/HTTP Category: Network Synopsis: A library for client-side HTTP@@ -64,6 +64,11 @@ description: Use version 1.0.x or below of the conduit package (for the test suite) default: False +Flag warp-tests+ description: Test against warp+ default: True+ manual: True+ Library Exposed-modules: Network.BufferType,@@ -87,7 +92,9 @@ Paths_HTTP GHC-options: -fwarn-missing-signatures -Wall - Build-depends: base >= 3.0 && < 4.8, network >= 2.2.0.1 && < 2.6, parsec >= 2.0 && < 3.2+ -- note the test harness constraints should be kept in sync with these+ -- where dependencies are shared+ Build-depends: base >= 3.0.3.1 && < 4.8, parsec >= 2.0 && < 3.2 Build-depends: array >= 0.2.0.0 && < 0.6, old-time >= 1.0.0.0 && < 1.2, bytestring >= 0.9.1.3 && < 0.11 Extensions: FlexibleInstances@@ -98,6 +105,13 @@ else Build-depends: mtl >= 2.0 && < 2.3 + if impl(ghc<6.12)+ -- clients get a "no buffering" error with+ -- GHC 6.10 and later versions of network+ Build-depends: network >= 2.2.0.1 && < 2.3+ else+ Build-depends: network >= 2.2.0.1 && < 2.6+ build-tools: ghc >= 6.10 && < 7.10 if flag(warn-as-error)@@ -116,30 +130,35 @@ other-modules: Httpd - -- note: version constraints are inherited from HTTP library stanza+ -- note: version constraints for dependencies shared with the library+ -- should be the same build-depends: HTTP,- HUnit,- httpd-shed,- mtl >= 2.0 && < 2.3,- bytestring >= 0.9 && < 0.11,- case-insensitive >= 0.4 && < 1.3,- deepseq >= 1.3 && < 1.4,- http-types >= 0.6 && < 0.9,- wai >= 1.2 && < 2.2,- warp >= 1.2 && < 2.2,- pureMD5 >= 2.1 && < 2.2,- base >= 2 && < 4.8,- network,- split >= 0.1 && < 0.3,- test-framework,- test-framework-hunit+ HUnit >= 1.2.0.1 && < 1.3,+ httpd-shed >= 0.4 && < 0.5,+ mtl >= 1.1.0.0 && < 2.3,+ bytestring >= 0.9.1.3 && < 0.11,+ deepseq >= 1.3.0.0 && < 1.4,+ pureMD5 >= 0.2.4 && < 2.2,+ base >= 3.0.3.1 && < 4.8,+ network >= 2.2.0.1 && < 2.6,+ split >= 0.1.3 && < 0.3,+ test-framework >= 0.2.0 && < 0.9,+ test-framework-hunit >= 0.2.0 && <0.4 - if flag(conduit10)- build-depends:- conduit >= 0.4 && < 1.1- else+ if flag(warp-tests)+ CPP-Options: -DWARP_TESTS build-depends:- conduit >= 1.1 && < 1.2,- conduit-extra >= 1.1 && < 1.2+ case-insensitive >= 0.2 && < 1.3,+ http-types >= 0.6.1 && < 0.9,+ wai >= 1.2.0 && < 2.2,+ warp >= 1.2.0 && < 2.2++ if flag(conduit10)+ build-depends:+ conduit >= 0.4.0 && < 1.1+ else+ build-depends:+ conduit >= 1.1 && < 1.2,+ conduit-extra >= 1.1 && < 1.2
Network/Browser.hs view
@@ -5,7 +5,7 @@ Copyright : See LICENSE file License : BSD -Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+Maintainer : Ganesh Sittampalam <ganesh@earth.li> Stability : experimental Portability : non-portable (not tested)
Network/BufferType.hs view
@@ -6,7 +6,7 @@ -- Copyright : See LICENSE file -- License : BSD ----- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/Auth.hs view
@@ -5,7 +5,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/Base.hs view
@@ -5,7 +5,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/Cookie.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/HandleStream.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/Headers.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/Proxy.hs view
@@ -5,7 +5,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --@@ -19,9 +19,17 @@ , parseProxy -- :: String -> Maybe Proxy ) where +{-+#if !defined(WIN32) && defined(mingw32_HOST_OS)+#define WIN32 1+#endif+-}+ import Control.Monad ( when, mplus, join, liftM2) +#if defined(WIN32) import Network.HTTP.Base ( catchIO )+#endif import Network.HTTP.Utils ( dropWhileTail, chopAtDelim ) import Network.HTTP.Auth import Network.URI
Network/HTTP/Stream.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD -- --- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/HTTP/Utils.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD ----- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/Stream.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD ----- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/StreamDebugger.hs view
@@ -4,7 +4,7 @@ -- Copyright : See LICENSE file -- License : BSD ----- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/StreamSocket.hs view
@@ -5,7 +5,7 @@ -- Copyright : See LICENSE file -- License : BSD ----- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
Network/TCP.hs view
@@ -5,7 +5,7 @@ -- Copyright : See LICENSE file -- License : BSD ----- Maintainer : Ganesh Sittampalam <http@projects.haskell.org>+-- Maintainer : Ganesh Sittampalam <ganesh@earth.li> -- Stability : experimental -- Portability : non-portable (not tested) --
test/Httpd.hs view
@@ -4,7 +4,10 @@ ( Request, Response, Server , mkResponse , reqMethod, reqURI, reqHeaders, reqBody- , shed, warp+ , shed+#ifdef WARP_TESTS+ , warp+#endif ) where @@ -12,11 +15,13 @@ import Control.Arrow ( (***) ) import Control.DeepSeq import Control.Monad-import Control.Monad.Trans ( lift )+import Control.Monad.Trans ( liftIO ) import Data.ByteString as B ( empty, concat, length, ByteString ) import Data.ByteString.Char8 as BC ( pack, unpack ) import Data.ByteString.Lazy.Char8 as BLC ( pack )+#ifdef WARP_TESTS import qualified Data.CaseInsensitive as CI ( mk, original )+#endif import Data.Maybe ( fromJust ) import Network.URI ( URI, parseRelativeReference ) @@ -24,7 +29,7 @@ ( Request, Response(Response), initServer , reqMethod, reqURI, reqHeaders, reqBody )-+#ifdef WARP_TESTS import qualified Data.Conduit.Lazy as Warp ( lazyConsume ) import qualified Network.HTTP.Types as Warp@@ -34,6 +39,7 @@ , responseLBS ) import qualified Network.Wai.Handler.Warp as Warp ( run )+#endif data Request = Request {@@ -80,11 +86,12 @@ rnf = rnf . B.length #endif +#ifdef WARP_TESTS warp :: Server warp port handler = Warp.run port $ \warpRequest -> do request <- requestFromWarp warpRequest- response <- handler request+ response <- liftIO $ handler request return (responseToWarp response) where responseToWarp (Response status hdrs body) =@@ -108,3 +115,4 @@ reqHeaders = map headerFromWarp (Warp.requestHeaders request), reqBody = BC.unpack (B.concat body) }+#endif
test/httpTests.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE ImplicitParams, ViewPatterns, NoMonomorphismRestriction #-}+{-# LANGUAGE ImplicitParams, ViewPatterns, NoMonomorphismRestriction, CPP #-} import Control.Concurrent import Control.Applicative ((<$))@@ -423,7 +423,7 @@ -- first bits of result text from haskell.org (just to give some representative text) haskellOrgText = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\-\<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\+\\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\ \\t<head>\ \\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\ \\t\t\t\t<meta name=\"keywords\" content=\"Haskell,Applications and libraries,Books,Foreign Function Interface,Functional programming,Hac Boston,HakkuTaikai,HaskellImplementorsWorkshop/2011,Haskell Communities and Activities Report,Haskell in education,Haskell in industry\" />"@@ -614,7 +614,12 @@ main = do args <- getArgs - let servers = [("httpd-shed", Httpd.shed), ("warp", Httpd.warp)]+ let servers =+ [ ("httpd-shed", Httpd.shed)+#ifdef WARP_TESTS+ , ("warp", Httpd.warp)+#endif+ ] basePortNum, altPortNum :: Int basePortNum = 5812 altPortNum = 80