Skip to content

Commit c4bf324

Browse files
committed
Treat responses without content-length or Transfer-Encoding as good responses
There is not a way to determine if responses without Content-Length or Transfer-Encoding are complete, this change treat them as good responses but flags them as "partial". This is backout change only for this functionality of 3c64a98
1 parent 6cbe684 commit c4bf324

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scrapy/core/downloader/handlers/http11.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,7 @@ def connectionLost(self, reason):
148148
body = self._bodybuf.getvalue()
149149
if reason.check(ResponseDone):
150150
self._finished.callback((self._txresponse, body, None))
151+
elif reason.check(PotentialDataLoss):
152+
self._finished.callback((self._txresponse, body, ['partial']))
151153
else:
152154
self._finished.errback(reason)

0 commit comments

Comments
 (0)