Merge lp:~cemsbr/duplicity/duplicity into lp:~duplicity-team/duplicity/0.7-series

Proposed by Carlos Eduardo Moreira dos Santos
Status: Merged
Merged at revision: 1087
Proposed branch: lp:~cemsbr/duplicity/duplicity
Merge into: lp:~duplicity-team/duplicity/0.7-series
Diff against target: 13 lines (+2/-1)
1 file modified
duplicity/backends/copycombackend.py (+2/-1)
To merge this branch: bzr merge lp:~cemsbr/duplicity/duplicity
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+256769@code.launchpad.net

Description of the change

* 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 '{'.

To post a comment you must log in.
lp:~cemsbr/duplicity/duplicity updated
1087. By Kenneth Loafman

* Merge in lp:~cemsbr/duplicity/duplicity
  - 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 '{'.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/backends/copycombackend.py'
2--- duplicity/backends/copycombackend.py 2015-01-31 23:30:49 +0000
3+++ duplicity/backends/copycombackend.py 2015-04-20 06:42:32 +0000
4@@ -69,7 +69,8 @@
5 raise CoPyCloud.Error("Got HTTP error " + str(res.status))
6
7 try:
8- if 'content-type' in res.headers and res.headers['content-type'] == 'application/json':
9+ if 'content-type' in res.headers and res.headers['content-type'] == 'application/json' \
10+ or res.data.startswith('{'):
11 jd = json.loads(res.data.decode(self.DEFAULT_ENCODING), self.DEFAULT_ENCODING)
12
13 if jd and 'result' in jd and jd['result'] == 'error':

Subscribers

People subscribed via source and target branches