mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
some sync fixes
- fix an extra \r\n being included at the end of the last form var - req()s in the middle of a sync should throw an exception if they receive a 403, as the calling code does not check for an empty return
This commit is contained in:
parent
7871949a6a
commit
d181133ac0
1 changed files with 3 additions and 2 deletions
|
@ -552,7 +552,7 @@ class HttpSyncer(object):
|
|||
# costly. We could send it as a raw post, but more HTTP clients seem to
|
||||
# support file uploading, so this is the more compatible choice.
|
||||
|
||||
def req(self, method, fobj=None, comp=6, badAuthRaises=False):
|
||||
def req(self, method, fobj=None, comp=6, badAuthRaises=True):
|
||||
BOUNDARY=b"Anki-sync-boundary"
|
||||
bdry = b"--"+BOUNDARY
|
||||
buf = io.BytesIO()
|
||||
|
@ -582,7 +582,8 @@ Content-Type: application/octet-stream\r\n\r\n""")
|
|||
tgt.close()
|
||||
break
|
||||
tgt.write(data)
|
||||
buf.write(b'\r\n' + bdry + b'--\r\n')
|
||||
buf.write(b"\r\n")
|
||||
buf.write(bdry + b'--\r\n')
|
||||
size = buf.tell()
|
||||
# connection headers
|
||||
headers = {
|
||||
|
|
Loading…
Reference in a new issue