summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/src/leap/soledad/client/http_target/fetch.py2
-rw-r--r--server/src/leap/soledad/server/sync.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/client/src/leap/soledad/client/http_target/fetch.py b/client/src/leap/soledad/client/http_target/fetch.py
index 24d73025..26606e9b 100644
--- a/client/src/leap/soledad/client/http_target/fetch.py
+++ b/client/src/leap/soledad/client/http_target/fetch.py
@@ -205,7 +205,7 @@ class HTTPDocFetcher(object):
line, comma = utils.check_and_strip_comma(data[index])
content, _ = utils.check_and_strip_comma(data[index + 1])
entry = json.loads(line)
- entries.append((entry['id'], entry['rev'], content,
+ entries.append((entry['id'], entry['rev'], content or None,
entry['gen'], entry['trans_id']))
except (IndexError, KeyError):
raise errors.BrokenSyncStream
diff --git a/server/src/leap/soledad/server/sync.py b/server/src/leap/soledad/server/sync.py
index 253139a9..77d4b840 100644
--- a/server/src/leap/soledad/server/sync.py
+++ b/server/src/leap/soledad/server/sync.py
@@ -251,7 +251,8 @@ class SyncResource(http_app.SyncResource):
entry = dict(id=doc.doc_id, rev=doc.rev,
gen=gen, trans_id=trans_id)
self.responder.stream_entry(entry)
- self.responder.stream_entry(doc.get_json().read())
+ content = doc.get_json()
+ self.responder.stream_entry(content.read() if content else '')
new_gen, number_of_changes = \
self.sync_exch.find_changes_to_return(received)