From a8cb5999d384f38671ba1a244636e72c99f3d8c6 Mon Sep 17 00:00:00 2001 From: xyzkab <13573557+xyzkab@users.noreply.github.com> Date: Mon, 6 Jan 2020 02:23:34 +0700 Subject: [PATCH] Fix missing header: iterate all items, skip if name/value is empty --- core/requester.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/requester.py b/core/requester.py index 1c80d03..b80bafa 100644 --- a/core/requester.py +++ b/core/requester.py @@ -28,8 +28,10 @@ class Requester(object): # Parse headers content = content.split('\n') - for header in content[1:-2]: - name, value = header.split(': ') + for header in content[1:]: + name, _, value = header.partition(': ') + if not name or not value: + continue self.headers[name] = value self.host = self.headers['Host']