diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-09-15 12:18:36 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-09-15 12:18:36 +0200 |
commit | 8e0ce6db971c18938ea6fd3a3a6a7c14df77b588 (patch) | |
tree | e0030efd97b80b249a49dc1df305b8174256881d /bin/ups | |
parent | faeb5e8ccc6dd363874e29e566f0f2b2d596bc08 (diff) |
bin/ups: urlquote the request target
Diffstat (limited to 'bin/ups')
-rwxr-xr-x | bin/ups | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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: |