Commit b507d36c authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Set the useragent string to be "cabal-install/$version"

eg, currently it is "cabal-install/0.4.2"
parent 6d3b9ff1
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment