mirror of
https://github.com/9001/copyparty.git
synced 2025-11-05 06:13:20 +00:00
md-editor: fix extra http roundtrip;
the check for a leading newline was not specific enough, accidentally matching the opening line of a json document, triggering the xhr safeguard and wasting a roundtrip
This commit is contained in:
@@ -4911,8 +4911,8 @@ class HttpCli(object):
|
||||
else:
|
||||
fullfile = b""
|
||||
|
||||
if not sz_md and b"\n" in buf[:2]:
|
||||
lead = buf[: buf.find(b"\n") + 1]
|
||||
if not sz_md and buf.startswith((b"\n", b"\r\n")):
|
||||
lead = b"\n" if buf.startswith(b"\n") else b"\r\n"
|
||||
sz_md += len(lead)
|
||||
|
||||
sz_md += len(buf)
|
||||
|
||||
Reference in New Issue
Block a user