mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
str should be applied first.
change based on @sirkonst feedback
This commit is contained in:
parent
46e041b9f1
commit
4da8f8067d
@ -211,6 +211,7 @@ class Response(object):
|
|||||||
for name, value in headers:
|
for name, value in headers:
|
||||||
assert isinstance(name, string_types), "%r is not a string" % name
|
assert isinstance(name, string_types), "%r is not a string" % name
|
||||||
|
|
||||||
|
value = str(value).strip()
|
||||||
lname = name.lower().strip()
|
lname = name.lower().strip()
|
||||||
if lname == "content-length":
|
if lname == "content-length":
|
||||||
self.response_length = int(value)
|
self.response_length = int(value)
|
||||||
@ -221,11 +222,11 @@ class Response(object):
|
|||||||
self.upgrade = True
|
self.upgrade = True
|
||||||
elif lname == "upgrade":
|
elif lname == "upgrade":
|
||||||
if value.lower().strip() == "websocket":
|
if value.lower().strip() == "websocket":
|
||||||
self.headers.append((name.strip(), value.strip()))
|
self.headers.append((name.strip(), value))
|
||||||
|
|
||||||
# ignore hopbyhop headers
|
# ignore hopbyhop headers
|
||||||
continue
|
continue
|
||||||
self.headers.append((name.strip(), str(value.strip())))
|
self.headers.append((name.strip(), value))
|
||||||
|
|
||||||
|
|
||||||
def is_chunked(self):
|
def is_chunked(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user