[common] detect empty HTTP response bodies

This commit is contained in:
Mike Fährmann
2017-09-25 13:01:10 +02:00
parent c51616f8d8
commit 9c138dfc1f
4 changed files with 10 additions and 7 deletions

View File

@@ -134,7 +134,7 @@ class NijieImageExtractor(NijieExtractor):
def get_job_metadata(self):
response = self.request(self.popup_url + self.image_id,
allow_redirects=False)
allow_redirects=False, allow_empty=True)
if 300 <= response.status_code < 400:
raise exception.NotFoundError("image")
self.page = response.text