Merge pull request #9924 from owncloud/eventsource-nginx-buffering

Prevent nginx from buffering event source events
This commit is contained in:
Robin Appelman 2014-07-28 16:17:35 +02:00
commit cb0ff19dc4

View file

@ -34,6 +34,7 @@ class OC_EventSource{
public function __construct() {
OC_Util::obEnd();
header('Cache-Control: no-cache');
header('X-Accel-Buffering: no');
$this->fallback=isset($_GET['fallback']) and $_GET['fallback']=='true';
if($this->fallback) {
$this->fallBackId=$_GET['fallback_id'];
@ -44,6 +45,7 @@ class OC_EventSource{
}
if( !OC_Util::isCallRegistered()) {
$this->send('error', 'Possible CSRF attack. Connection will be closed.');
$this->close();
exit();
}
flush();