From 2c4e06d3259bd70122008c9c31d65af015fa1d96 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sat, 26 Jul 2014 15:50:11 +0200 Subject: [PATCH] Prevent nginx from buffering event source events --- lib/private/eventsource.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/eventsource.php b/lib/private/eventsource.php index 5a41ddd8b3..192c1446b5 100644 --- a/lib/private/eventsource.php +++ b/lib/private/eventsource.php @@ -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();