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

This commit is contained in:
2026-06-20 00:09:46 +03:00
parent ad2156ed84
commit ab29aaeb14
2 changed files with 10 additions and 8 deletions
+9 -8
View File
@@ -12,11 +12,13 @@ class Response:
self.code = 200
self.phrase = 'Success'
self.version = 'HTTP/1.1'
self.headers = {}
self.content_type = "text/plain"
self.headers = {
'Content-Type': 'text/plain'
}
self.__content_type = 'text/plain'
for key in kwargs:
if key in self.__dict__:
setattr(self, key, kwargs[key])
if key in ['content_type', 'mimetype']:
self.__content_type = kwargs[key]
def __call__(self):
status = ' '.join([self.version, str(self.code), self.phrase])
@@ -27,7 +29,6 @@ class Response:
])
return raw
def __iter__(self):
pass
def __next__(self):
pass
@property
def content_type(self):
return self.__content_type
+1
View File
@@ -51,6 +51,7 @@ def str_next(instance):
if instance.position == 'headers':
instance.position = 'body'
raw = b''
response.headers['Content-Type'] = response.content_type
for key in response.headers:
value = response.headers[key]
raw += key.encode() + b' ' + value.encode() + crlf