修复图片

This commit is contained in:
cheney
2026-05-26 16:03:34 +08:00
parent 6240e453b0
commit be710920e9
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -140,7 +140,7 @@ def process_response_from_a():
if b"\r\n\r\n" in response and not headers_found:
headers_end = response.find(b"\r\n\r\n")
headers = response[:headers_end].decode('utf-8')
headers = response[:headers_end].decode('utf-8', errors='replace')
headers_found = True
for line in headers.split("\r\n"):
@@ -201,7 +201,7 @@ def handle_browser_request(browser_conn, browser_addr):
data += chunk
if b"\r\n\r\n" in data:
headers_end = data.find(b"\r\n\r\n")
headers = data[:headers_end].decode('utf-8')
headers = data[:headers_end].decode('utf-8', errors='replace')
content_length = 0
for line in headers.split("\r\n"):
@@ -216,7 +216,7 @@ def handle_browser_request(browser_conn, browser_addr):
if not data:
return
request_lines = data.decode('utf-8').split("\r\n")
request_lines = data.decode('utf-8', errors='replace').split("\r\n")
if request_lines:
first_line = request_lines[0]
parts = first_line.split()