Skip to content
Browse files

Partial Fix #543 by handling empty HTTP proxy uris

  • Loading branch information...
1 parent 8429f01 commit 090581792cb64aaf0acf243793fbde4a00ac5094 @arunchaganty arunchaganty committed Aug 27, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 cabal-install/Distribution/Client/HttpUtils.hs
View
9 cabal-install/Distribution/Client/HttpUtils.hs
@@ -45,7 +45,14 @@ trim = f . f
-- |Get the local proxy settings
--TODO: print info message when we're using a proxy based on verbosity
proxy :: Verbosity -> IO Proxy
-proxy verbosity = fetchProxy True
+proxy verbosity = do
+ p <- fetchProxy True
+ -- Handle empty proxy strings
+ return $ case p of
+ Proxy uri auth ->
+ let uri' = trim uri in
+ if uri' == "" then NoProxy else Proxy uri' auth
+ _ -> p
mkRequest :: URI -> Request ByteString
mkRequest uri = Request{ rqURI = uri

0 comments on commit 0905817

Please sign in to comment.
Something went wrong with that request. Please try again.