1
0
Fork 0

Bitbucket: fix redirect behaviour

pull/7752/head
Stephan Vock 2018-10-26 15:48:18 +02:00
parent 40a0c1d411
commit 8b8df01336
1 changed files with 3 additions and 0 deletions

View File

@ -385,15 +385,18 @@ class RemoteFilesystem
$statusCode = null;
$contentType = null;
$locationHeader = null;
if (!empty($http_response_header[0])) {
$statusCode = $this->findStatusCode($http_response_header);
$contentType = $this->findHeaderValue($http_response_header, 'content-type');
$locationHeader = $this->findHeaderValue($http_response_header, 'location');
}
// check for bitbucket login page asking to authenticate
if ($originUrl === 'bitbucket.org'
&& !$this->isPublicBitBucketDownload($fileUrl)
&& substr($fileUrl, -4) === '.zip'
&& (!$locationHeader || substr($locationHeader, -4) !== '.zip')
&& $contentType && preg_match('{^text/html\b}i', $contentType)
) {
$result = false;