mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #393 from sirkonst/fix_check_LimitRequestLine
Fix LimitRequestLine check.
This commit is contained in:
commit
f512679802
@ -164,15 +164,19 @@ class Request(Message):
|
||||
while True:
|
||||
idx = data.find("\r\n")
|
||||
if idx >= 0:
|
||||
# check if the request line is too large
|
||||
if idx > self.limit_request_line > 0:
|
||||
raise LimitRequestLine(idx, self.limit_request_line)
|
||||
break
|
||||
self.get_data(unreader, buf)
|
||||
data = buf.getvalue()
|
||||
|
||||
# check if the request line is too large
|
||||
# check if chunk is too large before read next chunk
|
||||
if len(data) - 2 > self.limit_request_line and \
|
||||
self.limit_request_line> 0 :
|
||||
raise LimitRequestLine(len(data), self.limit_request_line)
|
||||
|
||||
self.get_data(unreader, buf)
|
||||
data = buf.getvalue()
|
||||
|
||||
self.parse_request_line(data[:idx])
|
||||
buf = StringIO()
|
||||
buf.write(data[idx+2:]) # Skip \r\n
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user