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:
parent
4c63d9261a
commit
17586d15d5
@ -79,8 +79,8 @@ public abstract class MessageAggregator<I, S, C extends ByteBufHolder, O extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void validateMaxContentLength(int maxContentLength) {
|
private static void validateMaxContentLength(int maxContentLength) {
|
||||||
if (maxContentLength <= 0) {
|
if (maxContentLength < 0) {
|
||||||
throw new IllegalArgumentException("maxContentLength must be a positive integer: " + maxContentLength);
|
throw new IllegalArgumentException("maxContentLength: " + maxContentLength + " (expected: >= 0)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user