Skip to content

Commit

Permalink
Merge pull request #79 from sigmavirus24/unbreak-master
Browse files Browse the repository at this point in the history
Unbreak master
  • Loading branch information
sigmavirus24 committed Oct 24, 2015
2 parents b6f2af0 + ef04ac5 commit b957520
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions betamax/cassette/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def add_urllib3_response(serialized, response, headers):
preload_content=False,
original_response=MockHTTPResponse(headers)
)
# NOTE(sigmavirus24):
# urllib3 updated it's chunked encoding handling which breaks on recorded
# responses. Since a recorded response cannot be streamed appropriately
# for this handling to work, we can preserve the integrity of the data in
# the response by forcing the chunked attribute to always be False.
# This isn't pretty, but it is much better than munging a response.
h.chunked = False
response.raw = h


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cassette.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def setUp(self):
'string': decode('foo'),
'encoding': 'utf-8',
},
'headers': {'content-type': [decode('foo')]},
'headers': {'Content-Type': [decode('foo')]},
'status': {'code': 200, 'message': 'OK'},
'url': 'http://example.com',
},
Expand Down

0 comments on commit b957520

Please sign in to comment.