close file handle after sending sabre response

This commit is contained in:
Robin Appelman 2015-05-21 17:52:13 +02:00
parent 2f4f468399
commit 668fafd4d2

View file

@ -89,6 +89,12 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
$this->server->on('afterBind', array($this, 'sendFileIdHeader'));
$this->server->on('afterWriteContent', array($this, 'sendFileIdHeader'));
$this->server->on('afterMethod:GET', [$this,'httpGet']);
$this->server->on('afterResponse', function($request, ResponseInterface $response) {
$body = $response->getBody();
if (is_resource($body)) {
fclose($body);
}
});
}
/**