Browse Source

Retry file download also on Internal Server Error 500 code as is mostly a temporary glitch (at least on GitHub)

Albert Casademont 11 năm trước cách đây
mục cha
commit
5234e64e97
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/Composer/Downloader/FileDownloader.php

+ 1 - 1
src/Composer/Downloader/FileDownloader.php

@@ -107,7 +107,7 @@ class FileDownloader implements DownloaderInterface
                             break;
                         } catch (TransportException $e) {
                             // if we got an http response with a proper code, then requesting again will probably not help, abort
-                            if (0 !== $e->getCode() || !$retries) {
+                            if ((0 !== $e->getCode() && 500 !== $e->getCode()) || !$retries) {
                                 throw $e;
                             }
                             if ($this->io->isVerbose()) {