Allow MessageAggregator to disallow non-empty content

Motivation:

A user sometimes just want the aggregated message has no content at
all. (e.g. A user only wants HTTP GET requests.)

Modifications:

- Do not raise IllegalArgumentException even if a user specified
  the maxContentLength of 0

Result:

A user can disallow a message with non-empty content.
This commit is contained in:
Trustin Lee 2015-06-10 12:00:55 +09:00
parent 73d79a4b3b
commit 950da2eae1

View File

@ -79,8 +79,8 @@ public abstract class MessageAggregator<I, S, C extends ByteBufHolder, O extends
}
private static void validateMaxContentLength(int maxContentLength) {
if (maxContentLength <= 0) {
throw new IllegalArgumentException("maxContentLength must be a positive integer: " + maxContentLength);
if (maxContentLength < 0) {
throw new IllegalArgumentException("maxContentLength: " + maxContentLength + " (expected: >= 0)");
}
}