aboutsummaryrefslogtreecommitdiffstats
path: root/gps-track.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-04-12 11:14:01 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-04-15 09:11:25 +0200
commit5736ecebc53a8e97e986eb50e4a1611b410dcc14 (patch)
treee90d469eede5c77f73436d510bc56ccdbc8db081 /gps-track.rsc
parentd31afc9ec330634a2b66b346ee2d830ea5e5d436 (diff)
gps-track: use custom user agent string
Diffstat (limited to 'gps-track.rsc')
-rw-r--r--gps-track.rsc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gps-track.rsc b/gps-track.rsc
index f78dfe7..e2a4e16 100644
--- a/gps-track.rsc
+++ b/gps-track.rsc
@@ -17,6 +17,7 @@
:global GpsTrackUrl;
:global Identity;
+ :global FetchUserAgentStr;
:global LogPrint;
:global ScriptLock;
:global WaitFullyConnected;
@@ -31,10 +32,10 @@
:if ($Gps->"valid" = true) do={
:do {
- /tool/fetch check-certificate=yes-without-crl $GpsTrackUrl output=none \
- http-method=post http-header-field=({ "Content-Type: application/json" }) \
+ /tool/fetch check-certificate=yes-without-crl output=none http-method=post \
+ http-header-field=({ [ $FetchUserAgentStr $ScriptName ]; "Content-Type: application/json" }) \
http-data=[ :serialize to=json { "identity"=$Identity; \
- "lat"=($Gps->"latitude"); "lon"=($Gps->"longitude") } ] as-value;
+ "lat"=($Gps->"latitude"); "lon"=($Gps->"longitude") } ] $GpsTrackUrl as-value;
$LogPrint debug $ScriptName ("Sending GPS data in " . $CoordinateFormat . " format: " . \
"lat: " . ($Gps->"latitude") . " " . \
"lon: " . ($Gps->"longitude"));