Revert "merged branch povilas/issue_6101 (PR #6708)"

This reverts commit b2bcbbbd19, reversing
changes made to c5fcf0d0cc.
This commit is contained in:
Fabien Potencier 2013-02-11 13:46:49 +01:00
parent 95ba9449e2
commit f410931dd8

View File

@ -22,7 +22,6 @@ use Symfony\Component\HttpFoundation\File\Exception\FileException;
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
* @author Jordan Alliot <jordan.alliot@gmail.com> * @author Jordan Alliot <jordan.alliot@gmail.com>
* @author Sergey Linnik <linniksa@gmail.com> * @author Sergey Linnik <linniksa@gmail.com>
* @author Povilas Skruibis <puovils@gmail.com>
*/ */
class BinaryFileResponse extends Response class BinaryFileResponse extends Response
{ {
@ -124,23 +123,11 @@ class BinaryFileResponse extends Response
*/ */
public function setAutoEtag() public function setAutoEtag()
{ {
$this->setEtag($this->calculateFileHash($this->file->getPathname())); $this->setEtag(sha1_file($this->file->getPathname()));
return $this; 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. * Sets the Content-Disposition header with the given filename.
* *