Fixed the request line length check.

This commit is contained in:
George Notaras 2013-12-19 03:18:18 +02:00
parent 69ab24b589
commit b9fe01ca2c

View File

@ -213,12 +213,11 @@ class Request(Message):
if idx > limit > 0:
raise LimitRequestLine(idx, limit)
break
elif len(data) - 2 > limit > 0:
raise LimitRequestLine(len(data), limit)
self.get_data(unreader, buf)
data = buf.getvalue()
if len(data) - 2 > limit > 0:
raise LimitRequestLine(len(data), limit)
return (data[:idx], # request line,
data[idx + 2:]) # residue in the buffer, skip \r\n