From be3a5456339f66f98d2aaa42eebafbe9fcfa389f Mon Sep 17 00:00:00 2001 From: Shikha Mishra Date: Mon, 28 Jan 2019 23:22:46 +0530 Subject: [PATCH] updated Download.php --- .../Magento/Downloadable/Helper/Download.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Downloadable/Helper/Download.php b/app/code/Magento/Downloadable/Helper/Download.php index 349a22c383eb5..4832773f13d49 100644 --- a/app/code/Magento/Downloadable/Helper/Download.php +++ b/app/code/Magento/Downloadable/Helper/Download.php @@ -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;