eclipse-ee4j / eclipse-ee4j/jersey
[Feature request] Configuration options for multipart requests (Jersey 3.1.x)
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Following https://github.com/jakartaee/rest/issues/418#issuecomment-2009059009, this is a feature request to get some configuration options for multipart requests into Jersey (or maybe into the JAX-RS spec even where it would make sense).
Ideally there would be a way to set both generic options as well as endpoint specific options.
The endpoint specific settings could be configured via an annotation (Jersey specific or JAX-RS), while the generic options could follow the approach mentioned in https://github.com/jakartaee/rest/issues/418#issuecomment-2009123458.
The additional options would be:
* max request body size (for all parts), in bytes. Default can be unlimited to remain backwards compatible.
* max part size, in bytes. Default can be unlimited to remain backwards compatible.
* max number of parts per multipart request. Default can be unlimited to remain backwards compatible.
If either of these limits would be exceeded, an exception should be thrown, which by default should return a [HTTP 413](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) status code.
The annotation approach would be useful to override generic options, per endpoint. Imagine that some endpoints will have different requirements about part size or part count.
`commons-fileupload` offers similar options, see https://commons.apache.org/proper/commons-fileupload/using.html.
Let me know what you think @jansupol. Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.