summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-09-15 12:18:36 +0200
committerAnton Khirnov <anton@khirnov.net>2022-09-15 12:18:36 +0200
commit8e0ce6db971c18938ea6fd3a3a6a7c14df77b588 (patch)
treee0030efd97b80b249a49dc1df305b8174256881d
parentfaeb5e8ccc6dd363874e29e566f0f2b2d596bc08 (diff)
bin/ups: urlquote the request target
-rwxr-xr-xbin/ups5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/ups b/bin/ups
index 6ca206f..50e35ba 100755
--- a/bin/ups
+++ b/bin/ups
@@ -8,7 +8,7 @@ import shutil
import ssl
import subprocess
import sys
-from urllib import request, error as urlerror
+from urllib import parse, request, error as urlerror
try:
import magic
@@ -46,7 +46,8 @@ ssl_ctx.load_default_certs()
src = sys.stdin.buffer if args.path == '-' else open(args.path, 'rb')
-req = request.Request(server + dst_name, data = src, method = 'POST')
+req = request.Request(server + parse.quote(dst_name),
+ data = src, method = 'POST')
try:
resp = request.urlopen(req, context = ssl_ctx)
except KeyboardInterrupt: