Skip to content

Commit be3a545

Browse files
Shikha MishraAmol Chaudhari
authored andcommitted
updated Download.php
1 parent 0fc730b commit be3a545

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

app/code/Magento/Downloadable/Helper/Download.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,17 @@ public function setResource($resourceFile, $linkType = self::LINK_TYPE_FILE)
256256
}
257257
}
258258

259-
/**
260-
* check header
261-
*/
262-
263259
$this->_resourceFile = $resourceFile;
264-
$headers = array_change_key_case(get_headers($this->_resourceFile, 1), CASE_LOWER);
265-
if(isset($headers['location'])){
266-
$this->_resourceFile = is_array($headers['location']) ? current($headers['location']):
267-
$headers['location'];
260+
261+
/**
262+
* check header for urls
263+
*/
264+
if ($this->_linkType === self::LINK_TYPE_URL) {
265+
$headers = array_change_key_case(get_headers($this->_resourceFile, 1), CASE_LOWER);
266+
if(isset($headers['location'])){
267+
$this->_resourceFile = is_array($headers['location']) ? current($headers['location']):
268+
$headers['location'];
269+
}
268270
}
269271

270272
$this->_linkType = $linkType;

0 commit comments

Comments
 (0)