[
https://issues.apache.org/jira/browse/WW-5423?focusedWorklogId=922750&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-922750
]
ASF GitHub Bot logged work on WW-5423:
--------------------------------------
Author: ASF GitHub Bot
Created on: 10/Jun/24 05:02
Start Date: 10/Jun/24 05:02
Worklog Time Spent: 10m
Work Description: lukaszlenart merged PR #954:
URL: https://github.com/apache/struts/pull/954
Issue Time Tracking
-------------------
Worklog Id: (was: 922750)
Time Spent: 40m (was: 0.5h)
> Query Parameters in Multipart Requests not working in v7 M6
> -----------------------------------------------------------
>
> Key: WW-5423
> URL: https://issues.apache.org/jira/browse/WW-5423
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 7.0.0
> Reporter: Philip Crider
> Priority: Major
> Fix For: 7.0.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> One of the changes in [https://github.com/apache/struts/pull/861] broke query
> parameters in multipart requests. Their values are being lost.
> This is the old implementation, which returns null if the parameter doesn't
> exist.
> {code:java}
> public String[] getParameterValues(String name) {
> List<String> v = params.get(name);
> if (v != null && !v.isEmpty()) {
> return v.toArray(new String[0]);
> }
> return null;
> } {code}
>
> And this is the new implementation, which returns an empty array in that case.
> {code:java}
> public String[] getParameterValues(String name) {
> return parameters.getOrDefault(name, Collections.emptyList())
> .toArray(String[]::new);
> }{code}
>
> This method in MultiPartRequestWrapper is expecting null to be returned in
> that case.
> {code:java}
> public String[] getParameterValues(String name) {
> return ((multi == null) || (multi.getParameterValues(name) == null)) ?
> super.getParameterValues(name) : multi.getParameterValues(name);
> }{code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)