From 8e0ce6db971c18938ea6fd3a3a6a7c14df77b588 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 15 Sep 2022 12:18:36 +0200 Subject: bin/ups: urlquote the request target --- bin/ups | 5 +++-- 1 file 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: -- cgit v1.2.3