Skip to content

Commit b4e2089

Browse files
author
Andrea Ratto
committed
WIP handle streamed content
1 parent 207ca64 commit b4e2089

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: requests_toolbelt/utils/dump.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ def _dump_response_data(response, prefixes, bytearr):
104104

105105
bytearr.extend(prefix + b'\r\n')
106106

107-
bytearr.extend(response.content)
107+
if not response._content_consumed or response._content is False:
108+
bytearr.extend(b'<< Response body is being streamed >>')
109+
else:
110+
bytearr.extend(response.content)
108111

109112

110113
def _coerce_to_bytes(data):

0 commit comments

Comments
 (0)