mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
+1
-1
@@ -739,7 +739,7 @@ class Response(object):
|
||||
raise RuntimeError(
|
||||
'The content for this response was already consumed')
|
||||
|
||||
self._content = bytes().join(self.iter_content()) or None
|
||||
self._content = bytes().join(self.iter_content()) or bytes()
|
||||
# print repr(self._content)
|
||||
except AttributeError:
|
||||
self._content = None
|
||||
|
||||
@@ -795,5 +795,11 @@ class RequestsTestSuite(TestSetup, unittest.TestCase):
|
||||
s.get(httpbin('redirect', '4'))
|
||||
|
||||
|
||||
def test_empty_response(self):
|
||||
r = requests.get(httpbin('status', '404'))
|
||||
r.text
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user