Skip to content

Commit

Permalink
updated Download.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Shikha Mishra authored and Amol Chaudhari committed Feb 15, 2019
1 parent 0fc730b commit be3a545
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/code/Magento/Downloadable/Helper/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,17 @@ public function setResource($resourceFile, $linkType = self::LINK_TYPE_FILE)
}
}

/**
* check header
*/

$this->_resourceFile = $resourceFile;
$headers = array_change_key_case(get_headers($this->_resourceFile, 1), CASE_LOWER);
if(isset($headers['location'])){
$this->_resourceFile = is_array($headers['location']) ? current($headers['location']):
$headers['location'];

/**
* check header for urls
*/
if ($this->_linkType === self::LINK_TYPE_URL) {
$headers = array_change_key_case(get_headers($this->_resourceFile, 1), CASE_LOWER);
if(isset($headers['location'])){
$this->_resourceFile = is_array($headers['location']) ? current($headers['location']):
$headers['location'];
}
}

$this->_linkType = $linkType;
Expand Down

0 comments on commit be3a545

Please sign in to comment.