Эх сурвалжийг харах

Update code to work with #2766

Jordi Boggiano 11 жил өмнө
parent
commit
1851c29dd3

+ 5 - 5
src/Composer/Util/RemoteFilesystem.php

@@ -262,17 +262,17 @@ class RemoteFilesystem
             case STREAM_NOTIFY_FAILURE:
             case STREAM_NOTIFY_FAILURE:
             case STREAM_NOTIFY_AUTH_REQUIRED:
             case STREAM_NOTIFY_AUTH_REQUIRED:
                 if (401 === $messageCode) {
                 if (401 === $messageCode) {
+                    // Bail if the caller is going to handle authentication failures itself.
+                    if (!$this->retryAuthFailure) {
+                        break;
+                    }
+
                     if (!$this->io->isInteractive()) {
                     if (!$this->io->isInteractive()) {
                         $message = "The '" . $this->fileUrl . "' URL required authentication.\nYou must be using the interactive console";
                         $message = "The '" . $this->fileUrl . "' URL required authentication.\nYou must be using the interactive console";
 
 
                         throw new TransportException($message, 401);
                         throw new TransportException($message, 401);
                     }
                     }
 
 
-                    // Bail if the caller is going to handle authentication failures itself.
-                    if (!$this->retryAuthFailure) {
-                        throw new TransportException('The "'.$this->fileUrl.'" file could not be downloaded ('.trim($message).')', 401);
-                    }
-
                     $this->promptAuthAndRetry();
                     $this->promptAuthAndRetry();
                     break;
                     break;
                 }
                 }