summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/core/servers/basehttp.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py
index ef93e28f26..02957c51a2 100644
--- a/django/core/servers/basehttp.py
+++ b/django/core/servers/basehttp.py
@@ -101,6 +101,9 @@ class ServerHandler(simple_server.ServerHandler):
# connection.
if 'Content-Length' not in self.headers:
self.headers['Connection'] = 'close'
+ # Persistent connections require threading server.
+ elif not isinstance(self.request_handler.server, socketserver.ThreadingMixIn):
+ self.headers['Connection'] = 'close'
# Mark the connection for closing if it's set as such above or if the
# application sent the header.
if self.headers.get('Connection') == 'close':