Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: haskell/cabal
...
head fork: haskell/cabal
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 3 contributors
View
12 cabal-install/Distribution/Client/HttpUtils.hs
@@ -18,8 +18,8 @@ import Network.URI
import Network.Stream
( Result, ConnError(..) )
import Network.Browser
- ( Proxy (..), Authority (..), BrowserAction, browse
- , setOutHandler, setErrHandler, setProxy, setAuthorityGen, request)
+ ( Proxy (..), Authority(..), BrowserAction, browse, setAllowBasicAuth, setAuthorityGen
+ , setOutHandler, setErrHandler, setProxy, request)
import Control.Monad
( mplus, join, liftM, liftM2 )
import qualified Data.ByteString.Lazy.Char8 as ByteString
@@ -153,10 +153,10 @@ mkRequest uri = Request{ rqURI = uri
-- |Carry out a GET request, using the local proxy settings
getHTTP :: Verbosity -> URI -> IO (Result (Response ByteString))
getHTTP verbosity uri = liftM (\(_, resp) -> Right resp) $
- cabalBrowse verbosity (return ()) (request (mkRequest uri))
+ cabalBrowse verbosity Nothing (request (mkRequest uri))
cabalBrowse :: Verbosity
- -> BrowserAction s ()
+ -> Maybe (String, String)
-> BrowserAction s a
-> IO a
cabalBrowse verbosity auth act = do
@@ -165,8 +165,8 @@ cabalBrowse verbosity auth act = do
setProxy p
setErrHandler (warn verbosity . ("http error: "++))
setOutHandler (debug verbosity)
- auth
- setAuthorityGen (\_ _ -> return Nothing)
+ setAllowBasicAuth False
+ setAuthorityGen (\_ _ -> return auth)
act
downloadURI :: Verbosity
View
27 cabal-install/Distribution/Client/Upload.hs
@@ -15,12 +15,10 @@ import qualified Distribution.Client.BuildReports.Anonymous as BuildReport
import qualified Distribution.Client.BuildReports.Upload as BuildReport
import Network.Browser
- ( BrowserAction, request
- , Authority(..), addAuthority )
+ ( request )
import Network.HTTP
( Header(..), HeaderName(..), findHeader
, Request(..), RequestMethod(..), Response(..) )
-import Network.TCP (HandleStream)
import Network.URI (URI(uriPath), parseURI)
import Data.Char (intToDigit)
@@ -51,12 +49,7 @@ upload verbosity repos mUsername mPassword paths = do
else targetRepoURI{uriPath = uriPath targetRepoURI `FilePath.Posix.combine` "upload"}
Username username <- maybe promptUsername return mUsername
Password password <- maybe promptPassword return mPassword
- let auth = addAuthority AuthBasic {
- auRealm = "Hackage",
- auUsername = username,
- auPassword = password,
- auSite = uploadURI
- }
+ let auth = Just (username, password)
flip mapM_ paths $ \path -> do
notice verbosity $ "Uploading " ++ path ++ "... "
handlePackage verbosity uploadURI auth path
@@ -82,17 +75,9 @@ promptPassword = do
report :: Verbosity -> [Repo] -> Maybe Username -> Maybe Password -> IO ()
report verbosity repos mUsername mPassword = do
- let uploadURI = if isOldHackageURI targetRepoURI
- then legacyUploadURI
- else targetRepoURI{uriPath = ""}
Username username <- maybe promptUsername return mUsername
Password password <- maybe promptPassword return mPassword
- let auth = addAuthority AuthBasic {
- auRealm = "Hackage",
- auUsername = username,
- auPassword = password,
- auSite = uploadURI
- }
+ let auth = Just (username, password)
forM_ repos $ \repo -> case repoKind repo of
Left remoteRepo
-> do dotCabal <- defaultCabalDir
@@ -111,16 +96,14 @@ report verbosity repos mUsername mPassword = do
cabalBrowse verbosity auth $ BuildReport.uploadReports (remoteRepoURI remoteRepo) [(report', Just buildLog)]
return ()
Right{} -> return ()
- where
- targetRepoURI = remoteRepoURI $ last [ remoteRepo | Left remoteRepo <- map repoKind repos ] --FIXME: better error message when no repos are given
check :: Verbosity -> [FilePath] -> IO ()
check verbosity paths = do
flip mapM_ paths $ \path -> do
notice verbosity $ "Checking " ++ path ++ "... "
- handlePackage verbosity checkURI (return ()) path
+ handlePackage verbosity checkURI Nothing path
-handlePackage :: Verbosity -> URI -> BrowserAction (HandleStream String) ()
+handlePackage :: Verbosity -> URI -> Maybe (String, String)
-> FilePath -> IO ()
handlePackage verbosity uri auth path =
do req <- mkRequest uri path
View
4 cabal-install/cabal-install.cabal
@@ -1,5 +1,5 @@
Name: cabal-install
-Version: 1.16.0.2
+Version: 1.16.1.0
Synopsis: The command-line interface for Cabal and Hackage.
Description:
The \'cabal\' command-line program simplifies the process of managing
@@ -110,7 +110,7 @@ Executable cabal
build-depends: base >= 2 && < 5,
Cabal >= 1.16.0 && < 1.18,
filepath >= 1.0 && < 1.4,
- network >= 1 && < 3,
+ network >= 1 && < 2.6,
HTTP >= 4000.0.2 && < 4001,
zlib >= 0.4 && < 0.6,
time >= 1.1 && < 1.5,
View
3  cabal-install/changelog
@@ -1,4 +1,7 @@
-*-change-log-*-
+1.16.1.0 Ryan Thomas <ryan@ryant.org> May 2015
+ * More restrictive upper bound on network.
+ * Force cabal upload to always use digest auth and never basic auth.
0.14.0 Andres Loeh <andres@well-typed.com> April 2012
* Works with ghc-7.4

No commit comments for this range

Something went wrong with that request. Please try again.