mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
use text/plain on /api/metrics
This commit is contained in:
@@ -41,13 +41,17 @@ function submitEvents() {
|
||||
events
|
||||
})
|
||||
],
|
||||
{ type: 'application/json' }
|
||||
{ type: 'text/plain' } // see http://crbug.com/490015
|
||||
);
|
||||
events.splice(0);
|
||||
if (!navigator.sendBeacon) {
|
||||
return;
|
||||
}
|
||||
navigator.sendBeacon('/api/metrics', data);
|
||||
try {
|
||||
navigator.sendBeacon('/api/metrics', data);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
async function addEvent(event_type, event_properties) {
|
||||
|
||||
Reference in New Issue
Block a user