[commit: Cabal] master: Set the useragent string to be "cabal-install/$version" (b507d36)
Paolo Capriotti
p.capriotti at gmail.com
Tue May 8 00:10:09 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/b507d36c5d4736efb288d681c3cc8648077715c3
>---------------------------------------------------------------
commit b507d36c5d4736efb288d681c3cc8648077715c3
Author: Duncan Coutts <duncan at haskell.org>
Date: Tue Jan 15 16:03:47 2008 +0000
Set the useragent string to be "cabal-install/$version"
eg, currently it is "cabal-install/0.4.2"
>---------------------------------------------------------------
cabal-install/Hackage/HttpUtils.hs | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/cabal-install/Hackage/HttpUtils.hs b/cabal-install/Hackage/HttpUtils.hs
index 00dedc6..a81877f 100644
--- a/cabal-install/Hackage/HttpUtils.hs
+++ b/cabal-install/Hackage/HttpUtils.hs
@@ -16,6 +16,8 @@ import Control.Exception (try, bracket)
#endif
import System.Environment (getEnvironment)
+import Distribution.Version (showVersion)
+import qualified Paths_cabal_install (version)
import Distribution.Verbosity (Verbosity)
import Distribution.Simple.Utils (warn, debug)
@@ -74,8 +76,9 @@ uri2proxy _ = Nothing
mkRequest :: URI -> Request
mkRequest uri = Request{ rqURI = uri
, rqMethod = GET
- , rqHeaders = [Header HdrUserAgent "Cabal"]
+ , rqHeaders = [Header HdrUserAgent userAgent]
, rqBody = "" }
+ where userAgent = "cabal-install/" ++ showVersion Paths_cabal_install.version
-- |Carry out a GET request, using the local proxy settings
getHTTP :: Verbosity -> URI -> IO (Result Response)
More information about the Cvs-libraries
mailing list