[Question] Limiting request size
Hi everybody,
First of all, thank you all for all of your efforts on cloud gateway.
I'm trying to limit the request size on the gateway. I've come across with a similar question on StackOverflow which is concluded by this ongoing PR.
However, the approach in the PR doesn't cover the absence of the Content-Length header, which is not mandatory and the case for chunked requests[content-length represents the chunk's own size, not the total].
I've tried to add HttpObjectAggregator to pipeline after reactor.left.httpCodec. This way works for all requests, however, this approach came with a price. Since aggregator appends all the chunks, io.netty.util.internal.OutOfDirectMemoryError occurred under load.
I wonder what's the best way to restrict requests' size under the circumstances.
Sincerely,
beyond the approach of checking the content-length, I'm not sure. Maybe @violetagg or @smaldini has an idea.