From fa74b5f22b8629b4d9050353d5cd76e2fc8b75b2 Mon Sep 17 00:00:00 2001 From: lzskyline Date: Mon, 8 May 2023 11:25:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=9D=9E=E6=A0=87raw=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HackRequests/HackRequests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HackRequests/HackRequests.py b/HackRequests/HackRequests.py index 8706098..8c5737a 100644 --- a/HackRequests/HackRequests.py +++ b/HackRequests/HackRequests.py @@ -163,13 +163,14 @@ def httpraw(self, raw: str, **kwargs): raise Exception("ValueError") log = {} try: - method, path, protocol = raw[:index].split(" ") + firstline_arr = raw[:index].split(" ") + method, path, protocol = firstline_arr[0], ''.join(firstline_arr[1:-1]), firstline_arr[-1] except: raise Exception("Protocol format error") raw = raw[index + 1:] try: - host_start = raw.index("Host: ") + host_start = raw.lower().index("host: ") host_end = raw.index('\n', host_start) except ValueError: