HTTP 3000.0.0 → 3001.0.0
raw patch · 4 files changed
+46/−31 lines, 4 filesdep +arraydep ~basedep ~networknew-uploader
Dependencies added: array
Dependency ranges changed: base, network
Files
- HTTP.cabal +19/−6
- Network/Browser.hs +24/−6
- Network/HTTP.hs +3/−1
- Network/HTTP/MD5Aux.hs +0/−18
HTTP.cabal view
@@ -1,5 +1,7 @@ Name: HTTP-Version: 3000.0.0+Version: 3001.0.0+Cabal-Version: >= 1.2+Build-type: Simple License: BSD3 License-file: LICENSE Copyright: @@ -13,14 +15,25 @@ Maintainer: Bjorn Bringert <bjorn@bringert.net> Homepage: http://www.haskell.org/http/ Description: A library for client-side HTTP-Build-depends: base, network, parsec-Exposed-modules: ++Flag old-base+ description: Old, monolithic base+ default: False++Library+ Exposed-modules: Network.Stream, Network.TCP, - Network.HTTP,+ Network.HTTP, Network.Browser-Other-modules:+ Other-modules: Network.HTTP.Base64, Network.HTTP.MD5, Network.HTTP.MD5Aux-GHC-options: -O -fwarn-missing-signatures+ GHC-options: -fwarn-missing-signatures+ Build-depends: network, parsec++ if flag(old-base)+ Build-depends: base < 3+ else+ Build-depends: base >= 3, array
Network/Browser.hs view
@@ -363,6 +363,7 @@ challenge :: Parser (String,[(String,String)]) challenge = do { nme <- word+ ; spaces ; pps <- cprops ; return (map toLower nme,pps) }@@ -543,9 +544,9 @@ withAuthority :: Authority -> Request -> String withAuthority a rq = case a of AuthBasic _ _ user pass ->- "basic " ++ base64encode (auUsername a ++ ':' : auPassword a)+ "Basic " ++ base64encode (auUsername a ++ ':' : auPassword a) AuthDigest _ _ _ _ _ _ _ _ ->- "digest username=\"" ++ auUsername a + "Digest username=\"" ++ auUsername a ++ "\",realm=\"" ++ auRealm a ++ "\",nonce=\"" ++ auNonce a ++ "\",uri=\"" ++ digesturi@@ -593,8 +594,9 @@ ------------------ Proxy Stuff ----------------------------------- ------------------------------------------------------------------ -data Proxy = NoProxy- | Proxy String (Maybe Authority)+-- | Specifies if a proxy should be used for the request.+data Proxy = NoProxy -- ^ Don't use a proxy.+ | Proxy String (Maybe Authority) -- ^ Use the proxy given. Should be of the form "http:\/\/host:port", "host", "host:port", or "http:\/\/host" ------------------------------------------------------------------@@ -740,8 +742,24 @@ let rq''' = case ath of Nothing -> rq'' Just x -> insertHeader HdrProxyAuthorization (withAuthority x rq'') rq''- in dorequest (URIAuth "" str "") rq'''-+ -- Proxy can take multiple forms - look for http://host:port first,+ -- then host:port. Fall back to just the string given (probably a host name).+ proxyURIAuth =+ maybe notURI+ (\parsed -> maybe notURI+ id (uriAuthority parsed))+ (parseURI str)+ notURI =+ -- If the ':' is dropped from port below, dorequest will assume port 80. Leave it!+ let (host, port) = span (':'/=) str+ in+ if null port || null host+ then URIAuth "" str ""+ else URIAuth "" host port + in+ do+ out $ "proxy uri host: " ++ uriRegName proxyURIAuth ++ ", port: " ++ uriPort proxyURIAuth+ dorequest proxyURIAuth rq''' case e_rsp of Left v -> if (retrycount < 4) && (v == ErrorReset || v == ErrorClosed) then request' (denycount,redirectcount,retrycount+1,preempt) rq
Network/HTTP.hs view
@@ -98,6 +98,7 @@ Request(..), Response(..), RequestMethod(..),+ ResponseCode, simpleHTTP, simpleHTTP_, sendHTTP, receiveHTTP,@@ -470,13 +471,14 @@ -- | The HTTP request method, to be used in the 'Request' object. -- We are missing a few of the stranger methods, but these are -- not really necessary until we add full TLS.-data RequestMethod = HEAD | PUT | GET | POST | OPTIONS | TRACE+data RequestMethod = HEAD | PUT | GET | POST | DELETE | OPTIONS | TRACE deriving(Show,Eq) rqMethodMap = [("HEAD", HEAD), ("PUT", PUT), ("GET", GET), ("POST", POST),+ ("DELETE", DELETE), ("OPTIONS", OPTIONS), ("TRACE", TRACE)]
Network/HTTP/MD5Aux.hs view
@@ -7,24 +7,6 @@ import Data.Bits import Data.Word -{--Nasty kludge to create a type Zord64 which is really a Word64 but works-how we want in hugs ands nhc98 too...-Also need a rotate left function that actually works.--#ifdef __GLASGOW_HASKELL__-#define rotL rotateL-#include "Zord64_EASY.hs"-#else--> import Zord64_HARD- -> rotL :: Word32 -> Rotation -> Word32-> rotL a s = shiftL a s .|. shiftL a (s-32)--#endif--}- rotL x = rotateL x type Zord64 = Word64