← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~cemsbr/duplicity/duplicity into lp:duplicity

 

Carlos Eduardo Moreira dos Santos has proposed merging lp:~cemsbr/duplicity/duplicity into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~cemsbr/duplicity/duplicity/+merge/256769

* Fix bug 1432229 in Copy.com backend
  - Reply header has no content-type for JSON detection. Now, we also check
    whether the content starts with '{'.

-- 
Your team duplicity-team is requested to review the proposed merge of lp:~cemsbr/duplicity/duplicity into lp:duplicity.
=== modified file 'duplicity/backends/copycombackend.py'
--- duplicity/backends/copycombackend.py	2015-01-31 23:30:49 +0000
+++ duplicity/backends/copycombackend.py	2015-04-20 06:42:32 +0000
@@ -69,7 +69,8 @@
             raise CoPyCloud.Error("Got HTTP error " + str(res.status))
 
         try:
-            if 'content-type' in res.headers and res.headers['content-type'] == 'application/json':
+            if 'content-type' in res.headers and res.headers['content-type'] == 'application/json' \
+               or res.data.startswith('{'):
                 jd = json.loads(res.data.decode(self.DEFAULT_ENCODING), self.DEFAULT_ENCODING)
 
                 if jd and 'result' in jd and jd['result'] == 'error':


Follow ups