mirror of
https://github.com/9001/copyparty.git
synced 2025-09-28 12:42:26 -06: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:
parent
3e97a77784
commit
14b7e5143f
|
@ -4911,8 +4911,8 @@ class HttpCli(object):
|
||||||
else:
|
else:
|
||||||
fullfile = b""
|
fullfile = b""
|
||||||
|
|
||||||
if not sz_md and b"\n" in buf[:2]:
|
if not sz_md and buf.startswith((b"\n", b"\r\n")):
|
||||||
lead = buf[: buf.find(b"\n") + 1]
|
lead = b"\n" if buf.startswith(b"\n") else b"\r\n"
|
||||||
sz_md += len(lead)
|
sz_md += len(lead)
|
||||||
|
|
||||||
sz_md += len(buf)
|
sz_md += len(buf)
|
||||||
|
|
Loading…
Reference in a new issue