From 48f0c1c37b6622ce29efa32d5393f4a5d7418050 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Wed, 6 Nov 2019 04:54:16 -0500 Subject: [PATCH] All: Resolves #2042: Set user-agent header to Joplin/1.0 (#2064) closes #2042 --- ReactNativeClient/lib/WebDavApi.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ReactNativeClient/lib/WebDavApi.js b/ReactNativeClient/lib/WebDavApi.js index 6f980a054..11e523dd0 100644 --- a/ReactNativeClient/lib/WebDavApi.js +++ b/ReactNativeClient/lib/WebDavApi.js @@ -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;