From 079d551782afa79d952b5aeccbcd8d70f63d7130 Mon Sep 17 00:00:00 2001 From: Christoph Mack Date: Sat, 3 Sep 2016 14:09:36 +0200 Subject: [PATCH] Add missing boundary at end of multipart/form-data request body for requests that include no application/octet-stream data This makes the sync request sent to the /download endpoint valid multipart/form-data according to RFC 2046, 5.1 --- anki/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anki/sync.py b/anki/sync.py index 3691edfd6..0acf4ea0a 100644 --- a/anki/sync.py +++ b/anki/sync.py @@ -582,7 +582,7 @@ 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' + bdry + b'--\r\n') size = buf.tell() # connection headers headers = {