You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@struts.apache.org by "lukaszlenart (via GitHub)" <gi...@apache.org> on 2026/09/23 13:21:38 UTC
[PR] WW-5751 Treat a negative maximumSize as no upload size limit [struts]
lukaszlenart opened a new pull request, #1976:
URL: https://github.com/apache/struts/pull/1976
Fixes [WW-5751](https://issues.apache.org/jira/browse/WW-5751)
## Problem
Since 7.3.0, the `ActionFileUploadInterceptor` rejects every upload when `maximumSize` is set to the literal `null` in an interceptor-ref, with "The upload validation policy could not be resolved ... unresolved parameters: maximumSize".
The literal `null` was never converted to a null limit. OGNL cannot convert the string `"null"` to `Long` (`NoSuchMethodException: UploadPolicy.setMaximumSize(java.lang.String)`). In 7.2.1 that error was silently ignored, so `maximumSize` kept its default, which happens to be "no limit". Since WW-5659, a param that cannot be applied marks the upload policy unresolved and the upload is rejected. That behaviour is intended and stays.
Before this change there was also no sensible explicit way to lift the limit: `-1` is applied, but `-1 < file.length()` rejects every file.
## Change
- A negative `maximumSize`, e.g. `-1`, now disables the per-file size check. `null` still means no limit, as before.
- Javadoc of `ActionFileUploadInterceptor`, `AbstractFileUploadInterceptor#setMaximumSize` and `UploadPolicy#setMaximumSize` updated.
- The literal `"null"` still leaves the policy unresolved.
Workaround for 7.3.0 until this ships: `9223372036854775807` (`Long.MAX_VALUE`), posted on the ticket.
## Tests
- New `ActionFileUploadInterceptorTest#testAcceptFileWithNegativeMaxSizeHasNoLimit`. It failed before the change and passes after it.
- `ActionFileUploadInterceptorTest`, `LazyParamInjectorTest`, `LazyParamsAllowlistTest` and `DefaultInterceptorFactoryTest` pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-5751 Treat a negative maximumSize as no upload size limit [struts]
Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart merged PR #1976:
URL: https://github.com/apache/struts/pull/1976
--
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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-5751 Treat a negative maximumSize as no upload size limit [struts]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1976:
URL: https://github.com/apache/struts/pull/1976#issuecomment-5798126040
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1976) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1976&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1976&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1976&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [93.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1976&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1976&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1976)
--
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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-5751 Treat a negative maximumSize as no upload size limit [struts]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1976:
URL: https://github.com/apache/struts/pull/1976#issuecomment-5797853793
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1976) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1976&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1976&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1976&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [85.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1976&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1976&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1976)
--
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: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org