Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Store http auth creds by domain only

  • Loading branch information...
commit ac2fed29a4aa13272b3915055e1bba039b64db8b 1 parent 9d03dc5
Mark Achée machee authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/Composer/Downloader/GitDownloader.php
10 src/Composer/Downloader/GitDownloader.php
View
@@ -204,10 +204,10 @@ protected function runCommand($commandCallable, $url, $path = null)
preg_match('{(https?://)([^/]+/)(.*)$}i', $url, $match) &&
strpos($this->process->getErrorOutput(), 'fatal: Authentication failed') === 0
) {
- if ($saved = $this->io->hasAuthorization($match[1].$match[2])) {
- $auth = $this->io->getAuthorization($match[1].$match[2]);
+ if ($saved = $this->io->hasAuthorization($match[2])) {
+ $auth = $this->io->getAuthorization($match[2]);
} else {
- $this->io->write($match[1].$match[2].' ('.$match[3].') requires Authentication');
+ $this->io->write($match[1].$match[2].$match[3].' requires Authentication');
$auth = array(
'username' => $this->io->ask('Username: '),
'password' => $this->io->askAndHideAnswer('Password: '),
@@ -221,9 +221,9 @@ protected function runCommand($commandCallable, $url, $path = null)
if (0 === $this->process->execute($command, $handler)) {
if (!$saved) {
$saved = $this->io->ask('Save user/pass for other requests to '.
- $match[1].$match[2].' ? [y]/n: ');
+ $match[2].' ? [y]/n: ');
if (in_array($saved, array('y', 'Y', null), true)) {
- $this->io->setAuthorization($match[1].$match[2], $auth['username'], $auth['password']);
+ $this->io->setAuthorization($match[2], $auth['username'], $auth['password']);
$this->io->write('saved...');
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.