更新日志

This commit is contained in:
cheney
2026-05-26 18:05:05 +08:00
parent be710920e9
commit d11390e453
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -242,11 +242,13 @@ def handle_browser_request(browser_conn, browser_addr):
'timestamp': time.time()
}
if isinstance(data, bytes):
modified_data = ("X-Proxy-Request-ID: " + request_id + "\r\n").encode('utf-8') + data
if b"\r\n\r\n" in data:
headers_end = data.find(b"\r\n\r\n")
headers = data[:headers_end]
body = data[headers_end:]
modified_data = headers + ("\r\nX-Proxy-Request-ID: " + request_id).encode('utf-8') + body
else:
modified_data = "X-Proxy-Request-ID: " + request_id + "\r\n" + data
modified_data = modified_data.encode('utf-8')
modified_data = data + ("\r\nX-Proxy-Request-ID: " + request_id + "\r\n\r\n").encode('utf-8')
with a_device_lock:
try: