Skip to content

Commit e2cfd96

Browse files
committed
fix WSGI CONTENT_TYPE for django, fix ASGI lifespan off
1 parent 8464140 commit e2cfd96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/socketify/asgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ def listen(self, port_or_options, handler=None):
618618

619619
def run(self):
620620
if not self.lifespan:
621-
print("No lifespan!")
622621
self.server.run()
623622
return self
624623

@@ -742,6 +741,7 @@ def run_task():
742741
self.websocket,
743742
self.websocket_options,
744743
self.task_factory_max_items,
744+
self.lifespan
745745
)
746746
if self.listen_options:
747747
(port_or_options, handler) = self.listen_options

src/socketify/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def wsgi(ssl, response, info, user_data, aborted):
152152
environ[f"HTTP_{name.replace('-', '_').upper()}"] = value
153153
next_header = ffi.cast("socketify_header*", next_header.next)
154154

155-
environ["CONTENT_TYPE"] = environ.get("HTTP_CONTENT_TYPE", None)
155+
environ["CONTENT_TYPE"] = environ.get("HTTP_CONTENT_TYPE", "")
156156

157157
def start_response(status, headers):
158158
if isinstance(status, str):

0 commit comments

Comments
 (0)