summaryrefslogtreecommitdiff
path: root/Run/Que
diff options
context:
space:
mode:
Diffstat (limited to 'Run/Que')
-rwxr-xr-xRun/Que/client.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Run/Que/client.py b/Run/Que/client.py
index 8d90e7a..6a91d0c 100755
--- a/Run/Que/client.py
+++ b/Run/Que/client.py
@@ -55,19 +55,25 @@ def main(argv=None):
# loop until ^C
while not time.sleep(1):
with request.urlopen(
- f"{args.host}/{args.target}", data=data, timeout=MAX_TIMEOUT
+ f"{args.host}/{args.target}",
+ data=data,
+ timeout=MAX_TIMEOUT,
+ headers={"User-Agent": "Que/Client"},
) as req:
pass
else:
with request.urlopen(
- f"{args.host}/{args.target}", data=data, timeout=MAX_TIMEOUT
+ f"{args.host}/{args.target}",
+ data=data,
+ timeout=MAX_TIMEOUT,
+ headers={"User-Agent": "Que/Client"},
) as req:
pass
else:
# no input data, do a read instead
params = urllib.parse.urlencode({"poll": args.poll})
url = f"{args.host}/{args.target}?{params}"
- with request.urlopen(url) as req:
+ with request.urlopen(url, headers={"User-Agent": "Que/Client"}) as req:
if args.poll:
while not time.sleep(1):
msg = req.readline().decode("utf-8").strip()