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

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

                Author: ASF GitHub Bot
            Created on: 12/Dec/23 08:47
            Start Date: 12/Dec/23 08:47
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart commented on code in PR #807:
URL: https://github.com/apache/struts/pull/807#discussion_r1423652747


##########
core/src/main/java/org/apache/struts2/dispatcher/HttpParameters.java:
##########
@@ -29,25 +29,27 @@
 import java.util.TreeSet;
 
 @SuppressWarnings("unchecked")
-public class HttpParameters implements Map<String, Parameter>, Cloneable {
+public class HttpParameters implements Map<String, Parameter> {
 
     final private Map<String, Parameter> parameters;
 
     private HttpParameters(Map<String, Parameter> parameters) {
-        this.parameters = parameters;
+        this.parameters = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+        this.parameters.putAll(parameters);
     }
 
+    @SuppressWarnings("rawtypes")
     public static Builder create(Map requestParameterMap) {
         return new Builder(requestParameterMap);
     }
 
     public static Builder create() {
-        return new Builder(new HashMap<>());
+        return new Builder(new TreeMap<>(String.CASE_INSENSITIVE_ORDER));
     }
 
     public HttpParameters remove(Set<String> paramsToRemove) {
         for (String paramName : paramsToRemove) {
-            parameters.remove(paramName);
+            parameters.entrySet().removeIf(p -> 
p.getKey().equalsIgnoreCase(paramName));

Review Comment:
   Right, removed





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

    Worklog Id:     (was: 895141)
    Time Spent: 1h 10m  (was: 1h)

> Make HttpParameters case-insensitive
> ------------------------------------
>
>                 Key: WW-5370
>                 URL: https://issues.apache.org/jira/browse/WW-5370
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 6.4.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Currently {{HttpParameters}} are case-sensitive which can be misleading



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to