ffang commented on PR #3700:
URL: https://github.com/apache/cxf/pull/3700#issuecomment-6773527962
Hi @coheigea ,
Thanks for doing it.
Just one thing
**The limit can only be set JVM-wide.** It's read once from a system
property into `static final DEFAULT_MAX_BOUNDARY_LENGTH`. The neighbouring
limits, `ATTACHMENT_MAX_HEADER_SIZE` (`attachment-max-header-size`) and
`ATTACHMENT_HEADERS_MAX_COUNT` (`attachment-headers-max-count`), are contextual
message properties with the system property as their default:
```java
maxHeaderLength = MessageUtils.getContextualInteger(message,
ATTACHMENT_MAX_HEADER_SIZE,
DEFAULT_MAX_HEADER_SIZE);
```
Could the boundary length be read the same way? For example:
```java
public static final String ATTACHMENT_MAX_BOUNDARY_LENGTH =
"attachment-max-boundary-length";
...
maxBoundaryLength = MessageUtils.getContextualInteger(message,
ATTACHMENT_MAX_BOUNDARY_LENGTH,
DEFAULT_MAX_BOUNDARY_LENGTH);
```
Then a single endpoint or client could accept a non-compliant peer without
raising the limit for the whole JVM. This applies to clients too: a CXF client
now rejects a response whose boundary is over 70 characters.
WDYT?
Freeman
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]