From 573ad019d1d3f0d690d01bf87b6d29d967405f62 Mon Sep 17 00:00:00 2001 From: benoitc Date: Mon, 26 Mar 2012 18:20:30 +0200 Subject: [PATCH] fix websockets supports. Thanks Nikolay Kim for the tests and patch. --- gunicorn/http/wsgi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index dfdfe107..a485a420 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -195,6 +195,9 @@ class Response(object): # handle websocket if value.lower().strip() == "upgrade": self.upgrade = True + elif lname == "upgrade": + if value.lower().strip() == "websocket": + self.headers.append((name.strip(), str(value).strip())) # ignore hopbyhop headers continue