kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

XMLHttpRequest with POST #2

Closed Looooopy closed 6 years ago

Looooopy commented 6 years ago

Hi,

I just wonder if it is necessary to append with a random number on a POST request because they are not cached what I know about or am I missing something?

https://github.com/kutuluk/loglevel-plugin-remote/blob/master/src/remote.js#L178-L179

const xhr = new window.XMLHttpRequest();
xhr.open('POST', `${options.url}?r=${Math.random()}`, true);
kutuluk commented 6 years ago

Hi,

You're right. POST requests are not cached.

Thanks!

Fixed https://github.com/kutuluk/loglevel-plugin-remote/commit/24b1a55f0b609e1346576253d46b7950a42b25e2