428383 limit white space between requests

This commit is contained in:
Greg Wilkins 2014-02-18 10:02:00 +11:00
parent 352a1303e0
commit f092561a8a
1 changed files with 7 additions and 0 deletions

View File

@ -442,6 +442,13 @@ public class HttpParser
break;
else if (ch<0)
throw new BadMessage();
// count this white space as a header byte to avoid DOS
if (_maxHeaderBytes>0 && ++_headerBytes>_maxHeaderBytes)
{
LOG.warn("padding is too large >"+_maxHeaderBytes);
throw new BadMessage(HttpStatus.BAD_REQUEST_400);
}
}
return false;
}