diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-11 00:00:01 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-11 00:27:21 +0200 |
commit | d18bd17eb7d13010e3daef5351d7f7ec64480fd7 (patch) | |
tree | c1c729a778c41fc157ba546083fee9e86f174421 /core/js/eventsource.js | |
parent | d134ba9a82a904ba317d4a6d9a75e46ab9249ddc (diff) | |
download | nextcloud-server-d18bd17eb7d13010e3daef5351d7f7ec64480fd7.tar.gz nextcloud-server-d18bd17eb7d13010e3daef5351d7f7ec64480fd7.zip |
- eventsource.php: in case of potential CSRF attack we send an error message from the EventSource to the browser
- eventsource.js: handle undefined data on event
- update.js: in case of error we close the event source - advise the user to reload the page
- update.php: EventSource initialization is now done before we enter the maintenance mode in order to allow browser reload in case of possible CSRF attack
Diffstat (limited to 'core/js/eventsource.js')
-rw-r--r-- | core/js/eventsource.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/js/eventsource.js b/core/js/eventsource.js index ce8c8387c8e..536b180bc8f 100644 --- a/core/js/eventsource.js +++ b/core/js/eventsource.js @@ -110,7 +110,11 @@ OC.EventSource.prototype={ this.listeners[type].push(callback); }else{ this.source.addEventListener(type,function(e){ - callback(JSON.parse(e.data)); + if (typeof e.data != 'undefined') { + callback(JSON.parse(e.data)); + } else { + callback(''); + } },false); } }else{ |