Update
Тестирование ядра / Tester (push) Failing after 2s

This commit is contained in:
2026-06-20 01:59:35 +03:00
parent 608c2b86f4
commit eab8b71214
+5 -6
View File
@@ -4,7 +4,8 @@ __email__ = 'remizoffalex@mail.ru'
from io import IOBase
BUFF_SIZE = 1024
CRLF = b'\r\n'
# NEWLINE = b'\r\n'
NEWLINE = b'\n'
def handler_status(response):
@@ -14,7 +15,7 @@ def handler_status(response):
response.phrase
])
raw = status.encode()
raw += CRLF
raw += NEWLINE
return raw
@@ -23,8 +24,8 @@ def handler_headers(response):
response.headers['Content-Type'] = response.content_type
for key in response.headers:
value = response.headers[key]
raw += key.encode() + b': ' + value.encode() + CRLF
raw += CRLF
raw += key.encode() + b': ' + value.encode() + NEWLINE
raw += NEWLINE
return raw
@@ -49,7 +50,6 @@ def str_next(state):
if state.status == 'eof':
raise StopIteration
response = state.response
CRLF = b'\r\n'
if state.position == 'status':
raw = handler_status(response)
state.position = 'headers'
@@ -68,7 +68,6 @@ def stream_next(state):
if state.status == 'eof':
raise StopIteration
response = state.response
CRLF = b'\r\n'
if state.position == 'status':
raw = handler_status(response)
state.position = 'headers'