[ 
https://issues.apache.org/jira/browse/WW-5423?focusedWorklogId=921937&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-921937
 ]

ASF GitHub Bot logged work on WW-5423:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Jun/24 09:59
            Start Date: 04/Jun/24 09:59
    Worklog Time Spent: 10m 
      Work Description: sonarcloud[bot] commented on PR #954:
URL: https://github.com/apache/struts/pull/954#issuecomment-2147123378

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=954) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [C Maintainability Rating on New 
Code](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=954) 
(required ≥ A)  
     
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=954)
   
   ##   
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png
 '') Catch issues before they fail your Quality Gate with our IDE extension 
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png
 '') 
[SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 921937)
    Time Spent: 20m  (was: 10m)

> 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: 20m
>  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)

Reply via email to