From e2cfd96e7d1b16ae9b3c12d9105d6ebbaf97ae9c Mon Sep 17 00:00:00 2001 From: Ciro Date: Fri, 6 Jan 2023 11:47:40 -0300 Subject: [PATCH] fix WSGI CONTENT_TYPE for django, fix ASGI lifespan off --- src/socketify/asgi.py | 2 +- src/socketify/wsgi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socketify/asgi.py b/src/socketify/asgi.py index 750b11f..3ed9449 100644 --- a/src/socketify/asgi.py +++ b/src/socketify/asgi.py @@ -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 diff --git a/src/socketify/wsgi.py b/src/socketify/wsgi.py index 1bcb105..9732305 100644 --- a/src/socketify/wsgi.py +++ b/src/socketify/wsgi.py @@ -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):