mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
decode urlform messages
This commit is contained in:
parent
83fec3cca7
commit
53d3c8b28e
|
@ -306,7 +306,6 @@ roughly sorted by priority
|
|||
* reduce up2k roundtrips
|
||||
* start from a chunk index and just go
|
||||
* terminate client on bad data
|
||||
* drop onto folders
|
||||
* `os.copy_file_range` for up2k cloning
|
||||
* up2k partials ui
|
||||
* support pillow-simd
|
||||
|
|
|
@ -321,8 +321,19 @@ class HttpCli(object):
|
|||
elif "print" in opt:
|
||||
reader, _ = self.get_body_reader()
|
||||
for buf in reader:
|
||||
buf = buf.decode("utf-8", "replace")
|
||||
self.log("urlform @ {}\n {}\n".format(self.vpath, buf))
|
||||
orig = buf.decode("utf-8", "replace")
|
||||
m = "urlform_raw {} @ {}\n {}\n"
|
||||
self.log(m.format(len(orig), self.vpath, orig))
|
||||
try:
|
||||
plain = unquote(buf.replace(b"+", b" "))
|
||||
plain = plain.decode("utf-8", "replace")
|
||||
if buf.startswith(b"msg="):
|
||||
plain = plain[4:]
|
||||
|
||||
m = "urlform_dec {} @ {}\n {}\n"
|
||||
self.log(m.format(len(plain), self.vpath, plain))
|
||||
except Exception as ex:
|
||||
self.log(repr(ex))
|
||||
|
||||
if "get" in opt:
|
||||
return self.handle_get()
|
||||
|
|
Loading…
Reference in a new issue