armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Early rejection for requests exceeding configured maxRequestLength

Open yzfeng2020 opened this issue 1 year ago • 0 comments

It is is possible to implement early rejection of HTTP requests when the Content-Length header indicates a value larger than the maximum configured request length. This would be beneficial to avoid unnecessary processing of oversized requests.

The relevant code section is located at https://github.com/line/armeria/blob/d30dff0db75915e160b31a427f6f3c0c25fc003b/core/src/main/java/com/linecorp/armeria/server/Http1RequestDecoder.java#L211-L226 for H1 and https://github.com/line/armeria/blob/d30dff0db75915e160b31a427f6f3c0c25fc003b/core/src/main/java/com/linecorp/armeria/server/Http2RequestDecoder.java#L167-L180 for H2.

discord discussion: https://discord.com/channels/1087271586832318494/1087272728177942629/1275651316034699327

yzfeng2020 avatar Aug 21 '24 03:08 yzfeng2020