mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix request line length check
We were accidentally including partial data when we didn't find the request line terminating '\r\n'. This changes the check to make sure we're testing the length after we assert there's no termination.
This commit is contained in:
parent
5615464923
commit
489e935038
@ -165,12 +165,13 @@ class Request(Message):
|
||||
idx = data.find("\r\n")
|
||||
if idx >= 0:
|
||||
break
|
||||
self.get_data(unreader, buf)
|
||||
data = buf.getvalue()
|
||||
|
||||
if len(data) - 2 > 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