소스 검색

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

Albert Casademont 11 년 전
부모
커밋
5234e64e97
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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()) {