browser: simplify logServer
Use "fetch()" function to save logging client data to server side. Change-Id: I8b6a94b7ad7ae02ca00666759e3695867df4d372 Signed-off-by: Henry Castro <hcastro@collabora.com>
This commit is contained in:
parent
9f6824a620
commit
91a5831636
1 changed files with 5 additions and 5 deletions
|
@ -21,11 +21,11 @@ window.app = {
|
|||
(global.socket instanceof global.app.definitions.Socket) && global.socket.connected()) {
|
||||
global.socket.sendMessage(log);
|
||||
} else {
|
||||
var req = new XMLHttpRequest();
|
||||
var url = global.location.protocol + '//' + global.location.host + global.location.pathname.match(/.*\//) + 'logging.html';
|
||||
req.open('POST', url, true);
|
||||
req.setRequestHeader('Content-type','application/json; charset=utf-8');
|
||||
req.send(log);
|
||||
fetch(global.location.pathname.match(/.*\//) + 'logging.html', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type' : 'application/json' },
|
||||
body: log
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue