Merge pull request #23 from xyzkab/fix_missing_get_header

Fix missing header
pull/25/head
Swissky 2020-01-05 22:08:53 +01:00 committed by GitHub
commit 8aac206bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -28,8 +28,10 @@ class Requester(object):
# Parse headers # Parse headers
content = content.split('\n') content = content.split('\n')
for header in content[1:-2]: for header in content[1:]:
name, value = header.split(': ') name, _, value = header.partition(': ')
if not name or not value:
continue
self.headers[name] = value self.headers[name] = value
self.host = self.headers['Host'] self.host = self.headers['Host']