Skip to content

Commit

Permalink
Fix for issue #21299. Change HEAD action mapping to GET action interf…
Browse files Browse the repository at this point in the history
…ace and add HEAD request handling
  • Loading branch information
Oleksandr Iegorov committed Apr 18, 2019
1 parent b5683e8 commit 740e4bd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Magento\Framework\File\Mime;
use Magento\Framework\App\Request\Http as HttpRequest;
use Magento\Framework\App\ObjectManager;
use Zend\Http\Headers;

/**
* File adapter to send the file to the client.
Expand Down Expand Up @@ -114,7 +115,7 @@ private function getFilePath($options): string
private function prepareResponse($options, string $filepath): void
{
$mimeType = $this->mime->getMimeType($filepath);
if (is_array($options) && isset($options['headers']) && $options['headers'] instanceof \Zend\Http\Headers) {
if (is_array($options) && isset($options['headers']) && $options['headers'] instanceof Headers) {
$this->response->setHeaders($options['headers']);
}
$this->response->setHeader('Content-length', filesize($filepath));
Expand Down

0 comments on commit 740e4bd

Please sign in to comment.