Skip to content
Snippets Groups Projects
Commit 2c4e06d3 authored by Robin Appelman's avatar Robin Appelman
Browse files

Prevent nginx from buffering event source events

parent 40f2a34b
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment