1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

All: Resolves #2042: Set user-agent header to Joplin/1.0 (#2064)

closes #2042
This commit is contained in:
Helmut K. C. Tessarek 2019-11-06 04:54:16 -05:00 committed by Laurent Cozic
parent 17584b52af
commit 48f0c1c37b

View File

@ -350,6 +350,7 @@ class WebDavApi {
// finds out that no resource has this ID and simply sends the requested data.
// Also add a random value to make sure the eTag is unique for each call.
if (['GET', 'HEAD'].indexOf(method) < 0) headers['If-None-Match'] = `JoplinIgnore-${Math.floor(Math.random() * 100000)}`;
if (!headers['User-Agent']) headers['User-Agent'] = 'Joplin/1.0';
const fetchOptions = {};
fetchOptions.headers = headers;