Explorar o código

Account for ports in URL

Chris Smith %!s(int64=9) %!d(string=hai) anos
pai
achega
33f823146b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Composer/Util/RemoteFilesystem.php

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

@@ -316,7 +316,7 @@ class RemoteFilesystem
                     $urlHost = parse_url($this->fileUrl, PHP_URL_HOST);
 
                     // Replace path using hostname as an anchor.
-                    $targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).')(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl);
+                    $targetUrl = preg_replace('{^(.+(?://|@)'.preg_quote($urlHost).'(?::\d+)?)(?:[/\?].*)?$}', '\1'.$locationHeader, $this->fileUrl);
                 } else {
                     // Relative path; e.g. foo
                     // This actually differs from PHP which seems to add duplicate slashes.