Fork me on GitHub
#ring
<
2016-08-16
>
ska15:08:55

Has anyone ever tried to protect a ring-powered Jetty server against very large requests (POST, PUT, the unusual GET with a body)? I know about org.eclipse.jetty.server.Request.maxFormContentSize but that does only protect against requests which contain a valid content-length if I read https://github.com/eclipse/jetty.project/blob/jetty-9.3.x/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java#L495 correctly (stepping into the getContentLength(), too)

ska15:08:37

Ideally, I would like to accept only requests with a content length that is small enough and then read only that many bytes from the body. I think, I could do it in a middleware, but I have not yet done enough research on that.