mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix request line check. close #390
We never had the possibility to check the limit since we were quitting the loop before it.
This commit is contained in:
parent
db8cd1f74b
commit
4b478e1a66
@ -165,13 +165,14 @@ class Request(Message):
|
|||||||
idx = data.find("\r\n")
|
idx = data.find("\r\n")
|
||||||
if idx >= 0:
|
if idx >= 0:
|
||||||
break
|
break
|
||||||
|
|
||||||
if len(data) - 2 > self.limit_request_line > 0:
|
|
||||||
raise LimitRequestLine(len(data), self.limit_request_line)
|
|
||||||
|
|
||||||
self.get_data(unreader, buf)
|
self.get_data(unreader, buf)
|
||||||
data = buf.getvalue()
|
data = buf.getvalue()
|
||||||
|
|
||||||
|
# check if the request line is too large
|
||||||
|
if len(data) - 2 > self.limit_request_line and \
|
||||||
|
self.limit_request_line> 0 :
|
||||||
|
raise LimitRequestLine(len(data), self.limit_request_line)
|
||||||
|
|
||||||
self.parse_request_line(data[:idx])
|
self.parse_request_line(data[:idx])
|
||||||
buf = StringIO()
|
buf = StringIO()
|
||||||
buf.write(data[idx+2:]) # Skip \r\n
|
buf.write(data[idx+2:]) # Skip \r\n
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user