private static StreamSourceConduit fixedLengthStreamSourceConduitWrapper(final long contentLength, final StreamSourceConduit conduit, final HttpServerExchange exchange) {
final long max = maxEntitySize(exchange);
if (max > 0 && contentLength > max) {
return new BrokenStreamSourceConduit(conduit, UndertowMessages.MESSAGES.requestEntityWasTooLarge(exchange.getSourceAddress(), max));
}
return new FixedLengthStreamSourceConduit(conduit, contentLength, fixedLengthDrainListener(exchange));
}