Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #47 from davidlmorton/requests_fix
Browse files Browse the repository at this point in the history
Requests 2.9.1 changed behavior of dict coersion of CaseInsensitveDict
  • Loading branch information
davidlmorton committed Jan 6, 2016
2 parents 14e4e35 + f290868 commit 89db8b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ptero_common/celery/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def run(self, method, url, **kwargs):
"data": kwargs,
"status_code": response.status_code,
"text": response.text,
"headers": dict(response.headers),
"headers": lowercase_dict(response.headers),
}

if response.status_code < 200 or response.status_code >= 300:
Expand All @@ -72,5 +72,9 @@ def body(self, kwargs):
return json.dumps(kwargs)


def lowercase_dict(dict_like):
return {key.lower(): value for key, value in dict_like.iteritems()}


class HTTPWithResult(HTTP):
ignore_result = False

0 comments on commit 89db8b9

Please sign in to comment.