Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
b507d36c
Commit
b507d36c
authored
Jan 15, 2008
by
Duncan Coutts
Browse files
Set the useragent string to be "cabal-install/$version"
eg, currently it is "cabal-install/0.4.2"
parent
6d3b9ff1
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Hackage/HttpUtils.hs
View file @
b507d36c
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment