fix WSGI CONTENT_TYPE for django, fix ASGI lifespan off

pull/75/head
Ciro 2023-01-06 11:47:40 -03:00
rodzic 846414056e
commit e2cfd96e7d
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -618,7 +618,6 @@ class _ASGI:
def run(self):
if not self.lifespan:
print("No lifespan!")
self.server.run()
return self
@ -742,6 +741,7 @@ class ASGI:
self.websocket,
self.websocket_options,
self.task_factory_max_items,
self.lifespan
)
if self.listen_options:
(port_or_options, handler) = self.listen_options

Wyświetl plik

@ -152,7 +152,7 @@ def wsgi(ssl, response, info, user_data, aborted):
environ[f"HTTP_{name.replace('-', '_').upper()}"] = value
next_header = ffi.cast("socketify_header*", next_header.next)
environ["CONTENT_TYPE"] = environ.get("HTTP_CONTENT_TYPE", None)
environ["CONTENT_TYPE"] = environ.get("HTTP_CONTENT_TYPE", "")
def start_response(status, headers):
if isinstance(status, str):