Revert "merged branch povilas/issue_6101 (PR #6708)"
This reverts commitb2bcbbbd19
, reversing changes made toc5fcf0d0cc
.
This commit is contained in:
parent
95ba9449e2
commit
f410931dd8
@ -22,7 +22,6 @@ use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
||||
* @author Igor Wiedler <igor@wiedler.ch>
|
||||
* @author Jordan Alliot <jordan.alliot@gmail.com>
|
||||
* @author Sergey Linnik <linniksa@gmail.com>
|
||||
* @author Povilas Skruibis <puovils@gmail.com>
|
||||
*/
|
||||
class BinaryFileResponse extends Response
|
||||
{
|
||||
@ -124,23 +123,11 @@ class BinaryFileResponse extends Response
|
||||
*/
|
||||
public function setAutoEtag()
|
||||
{
|
||||
$this->setEtag($this->calculateFileHash($this->file->getPathname()));
|
||||
$this->setEtag(sha1_file($this->file->getPathname()));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate file hash
|
||||
*
|
||||
* @param string $filename The path to the file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function calculateFileHash($filename)
|
||||
{
|
||||
return sha1_file($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Content-Disposition header with the given filename.
|
||||
*
|
||||
|
Reference in New Issue
Block a user