diff --git a/app/code/Magento/Downloadable/Helper/Download.php b/app/code/Magento/Downloadable/Helper/Download.php index adb3378f23e46..58ae9a1050c9d 100644 --- a/app/code/Magento/Downloadable/Helper/Download.php +++ b/app/code/Magento/Downloadable/Helper/Download.php @@ -255,10 +255,19 @@ 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']; + } + $this->_linkType = $linkType; - return $this; }