mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix: don't enforce the content length
we were trying to enforce the content length when the websocket key was received but we should instead rely on the headers provided in the request. Enforcing the expectation of the content length should be done by the client side not by us. Changes: * remove content-length header enforcing in message.p when the "Sec-WebSocket-Key1" header was found
This commit is contained in:
parent
b80a329354
commit
b3f9815aba
@ -131,6 +131,7 @@ class Message(object):
|
||||
def set_body_reader(self):
|
||||
chunked = False
|
||||
content_length = None
|
||||
|
||||
for (name, value) in self.headers:
|
||||
if name == "CONTENT-LENGTH":
|
||||
if content_length is not None:
|
||||
@ -139,8 +140,6 @@ class Message(object):
|
||||
elif name == "TRANSFER-ENCODING":
|
||||
if value.lower() == "chunked":
|
||||
chunked = True
|
||||
elif name == "SEC-WEBSOCKET-KEY1":
|
||||
content_length = 8
|
||||
|
||||
if chunked:
|
||||
self.body = Body(ChunkedReader(self, self.unreader))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user