actually fix #1115

This commit is contained in:
Maximilian Hils 2016-05-06 12:48:44 -07:00
parent 99178c57db
commit 9ac9df82c4

View File

@ -171,7 +171,7 @@ class StreamLargeBodies(object):
expected_size = http1.expected_http_body_size( expected_size = http1.expected_http_body_size(
flow.request, flow.response if not is_request else None flow.request, flow.response if not is_request else None
) )
if not (0 <= expected_size <= self.max_size): if not r.content and not (0 <= expected_size <= self.max_size):
# r.stream may already be a callable, which we want to preserve. # r.stream may already be a callable, which we want to preserve.
r.stream = r.stream or True r.stream = r.stream or True