You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2023/12/05 06:42:56 UTC
(struts) branch release/struts-2-5-x updated (649db4dee -> ca8d57c53)
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a change to branch release/struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git
from 649db4dee [maven-release-plugin] prepare for next development iteration
new 162e29fee Makes HttpParameters case-insensitive
new ca8d57c53 [maven-release-plugin] prepare release STRUTS_2_5_33
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
apps/pom.xml | 2 +-
apps/rest-showcase/pom.xml | 4 +-
apps/showcase/pom.xml | 2 +-
assembly/pom.xml | 2 +-
bom/pom.xml | 6 +-
bundles/admin/pom.xml | 2 +-
bundles/demo/pom.xml | 2 +-
bundles/pom.xml | 2 +-
core/pom.xml | 2 +-
.../apache/struts2/dispatcher/HttpParameters.java | 47 +++++++++++++---
.../struts2/dispatcher/HttpParametersTest.java | 65 ++++++++++++++++++++++
plugins/bean-validation/pom.xml | 2 +-
plugins/cdi/pom.xml | 2 +-
plugins/config-browser/pom.xml | 2 +-
plugins/convention/pom.xml | 2 +-
plugins/dwr/pom.xml | 2 +-
plugins/embeddedjsp/pom.xml | 2 +-
plugins/gxp/pom.xml | 2 +-
plugins/jasperreports/pom.xml | 2 +-
plugins/javatemplates/pom.xml | 2 +-
plugins/jfreechart/pom.xml | 2 +-
plugins/json/pom.xml | 2 +-
plugins/junit/pom.xml | 2 +-
plugins/osgi/pom.xml | 2 +-
plugins/oval/pom.xml | 2 +-
plugins/pell-multipart/pom.xml | 2 +-
plugins/plexus/pom.xml | 2 +-
plugins/pom.xml | 2 +-
plugins/portlet-tiles/pom.xml | 2 +-
plugins/portlet/pom.xml | 2 +-
plugins/rest/pom.xml | 2 +-
plugins/sitegraph/pom.xml | 2 +-
plugins/sitemesh/pom.xml | 2 +-
plugins/spring/pom.xml | 2 +-
plugins/testng/pom.xml | 2 +-
plugins/tiles/pom.xml | 2 +-
pom.xml | 6 +-
37 files changed, 144 insertions(+), 48 deletions(-)
create mode 100644 core/src/test/java/org/apache/struts2/dispatcher/HttpParametersTest.java
(struts) 02/02: [maven-release-plugin] prepare release STRUTS_2_5_33
Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch release/struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git
commit ca8d57c538136983a0180ac508ebcfabaf73f839
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Tue Dec 5 07:42:52 2023 +0100
[maven-release-plugin] prepare release STRUTS_2_5_33
---
apps/pom.xml | 2 +-
apps/rest-showcase/pom.xml | 4 ++--
apps/showcase/pom.xml | 2 +-
assembly/pom.xml | 2 +-
bom/pom.xml | 6 +++---
bundles/admin/pom.xml | 2 +-
bundles/demo/pom.xml | 2 +-
bundles/pom.xml | 2 +-
core/pom.xml | 2 +-
plugins/bean-validation/pom.xml | 2 +-
plugins/cdi/pom.xml | 2 +-
plugins/config-browser/pom.xml | 2 +-
plugins/convention/pom.xml | 2 +-
plugins/dwr/pom.xml | 2 +-
plugins/embeddedjsp/pom.xml | 2 +-
plugins/gxp/pom.xml | 2 +-
plugins/jasperreports/pom.xml | 2 +-
plugins/javatemplates/pom.xml | 2 +-
plugins/jfreechart/pom.xml | 2 +-
plugins/json/pom.xml | 2 +-
plugins/junit/pom.xml | 2 +-
plugins/osgi/pom.xml | 2 +-
plugins/oval/pom.xml | 2 +-
plugins/pell-multipart/pom.xml | 2 +-
plugins/plexus/pom.xml | 2 +-
plugins/pom.xml | 2 +-
plugins/portlet-tiles/pom.xml | 2 +-
plugins/portlet/pom.xml | 2 +-
plugins/rest/pom.xml | 2 +-
plugins/sitegraph/pom.xml | 2 +-
plugins/sitemesh/pom.xml | 2 +-
plugins/spring/pom.xml | 2 +-
plugins/testng/pom.xml | 2 +-
plugins/tiles/pom.xml | 2 +-
pom.xml | 6 +++---
35 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/apps/pom.xml b/apps/pom.xml
index b3359f2aa..0dce17c87 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-apps</artifactId>
<packaging>pom</packaging>
diff --git a/apps/rest-showcase/pom.xml b/apps/rest-showcase/pom.xml
index 35506e659..8851cadeb 100644
--- a/apps/rest-showcase/pom.xml
+++ b/apps/rest-showcase/pom.xml
@@ -24,12 +24,12 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
<name>Struts 2 Rest Showcase Webapp</name>
<description>Struts 2 Rest Showcase Example</description>
diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml
index 6b0179a48..c48feb3db 100644
--- a/apps/showcase/pom.xml
+++ b/apps/showcase/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-showcase</artifactId>
diff --git a/assembly/pom.xml b/assembly/pom.xml
index 2f9c12b4d..d9fc019ee 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-assembly</artifactId>
diff --git a/bom/pom.xml b/bom/pom.xml
index 2725d8b80..a2da7b6d1 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -30,7 +30,7 @@
</parent>
<artifactId>struts2-bom</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
<packaging>pom</packaging>
<name>Struts 2 Bill of Materials</name>
@@ -45,7 +45,7 @@
</licenses>
<properties>
- <struts-version.version>2.5.33-SNAPSHOT</struts-version.version>
+ <struts-version.version>2.5.33</struts-version.version>
<maven.site.skip>true</maven.site.skip>
<maven.site.deploy.skip>true</maven.site.deploy.skip>
</properties>
@@ -181,7 +181,7 @@
</dependencyManagement>
<scm>
- <tag>STRUTS_2_5_27</tag>
+ <tag>STRUTS_2_5_33</tag>
<connection>scm:git:https://gitbox.apache.org/repos/asf/struts.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/struts.git</developerConnection>
<url>https://github.com/apache/struts/</url>
diff --git a/bundles/admin/pom.xml b/bundles/admin/pom.xml
index 57bf7b245..8d2e4c21a 100644
--- a/bundles/admin/pom.xml
+++ b/bundles/admin/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-osgi-admin-bundle</artifactId>
diff --git a/bundles/demo/pom.xml b/bundles/demo/pom.xml
index dd5eecd2c..011b503f7 100644
--- a/bundles/demo/pom.xml
+++ b/bundles/demo/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-osgi-demo-bundle</artifactId>
diff --git a/bundles/pom.xml b/bundles/pom.xml
index 860a03a7d..59572eb60 100755
--- a/bundles/pom.xml
+++ b/bundles/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-osgi-bundles</artifactId>
diff --git a/core/pom.xml b/core/pom.xml
index b61806799..ef53f6eff 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-core</artifactId>
<packaging>jar</packaging>
diff --git a/plugins/bean-validation/pom.xml b/plugins/bean-validation/pom.xml
index 37d2856b6..d4b850617 100644
--- a/plugins/bean-validation/pom.xml
+++ b/plugins/bean-validation/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/plugins/cdi/pom.xml b/plugins/cdi/pom.xml
index 570ff3d43..cc27a2d83 100644
--- a/plugins/cdi/pom.xml
+++ b/plugins/cdi/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-cdi-plugin</artifactId>
diff --git a/plugins/config-browser/pom.xml b/plugins/config-browser/pom.xml
index 7e472a5d6..2ddb61a2e 100644
--- a/plugins/config-browser/pom.xml
+++ b/plugins/config-browser/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-config-browser-plugin</artifactId>
diff --git a/plugins/convention/pom.xml b/plugins/convention/pom.xml
index ad3134e1b..cfddcf951 100644
--- a/plugins/convention/pom.xml
+++ b/plugins/convention/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-convention-plugin</artifactId>
diff --git a/plugins/dwr/pom.xml b/plugins/dwr/pom.xml
index e55072f5f..dc69f6904 100644
--- a/plugins/dwr/pom.xml
+++ b/plugins/dwr/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-dwr-plugin</artifactId>
diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml
index cd2ec75bc..d0be07977 100644
--- a/plugins/embeddedjsp/pom.xml
+++ b/plugins/embeddedjsp/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-embeddedjsp-plugin</artifactId>
diff --git a/plugins/gxp/pom.xml b/plugins/gxp/pom.xml
index 41fa75ced..16083e348 100644
--- a/plugins/gxp/pom.xml
+++ b/plugins/gxp/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-gxp-plugin</artifactId>
diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml
index 6fccd32c3..02c14978c 100644
--- a/plugins/jasperreports/pom.xml
+++ b/plugins/jasperreports/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-jasperreports-plugin</artifactId>
diff --git a/plugins/javatemplates/pom.xml b/plugins/javatemplates/pom.xml
index c0d57539a..7473238b3 100644
--- a/plugins/javatemplates/pom.xml
+++ b/plugins/javatemplates/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-javatemplates-plugin</artifactId>
diff --git a/plugins/jfreechart/pom.xml b/plugins/jfreechart/pom.xml
index 8d1c9f94e..ad863d50d 100644
--- a/plugins/jfreechart/pom.xml
+++ b/plugins/jfreechart/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-jfreechart-plugin</artifactId>
diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml
index 1f24c7517..b66c4a45c 100644
--- a/plugins/json/pom.xml
+++ b/plugins/json/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-json-plugin</artifactId>
diff --git a/plugins/junit/pom.xml b/plugins/junit/pom.xml
index 382a34ae4..86b4ae49a 100644
--- a/plugins/junit/pom.xml
+++ b/plugins/junit/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-junit-plugin</artifactId>
diff --git a/plugins/osgi/pom.xml b/plugins/osgi/pom.xml
index 3d90d7ab8..bec72f435 100644
--- a/plugins/osgi/pom.xml
+++ b/plugins/osgi/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-osgi-plugin</artifactId>
diff --git a/plugins/oval/pom.xml b/plugins/oval/pom.xml
index 95ee4bf89..9bb2f33d8 100644
--- a/plugins/oval/pom.xml
+++ b/plugins/oval/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-oval-plugin</artifactId>
diff --git a/plugins/pell-multipart/pom.xml b/plugins/pell-multipart/pom.xml
index 0afeebe0f..ca4c8204f 100644
--- a/plugins/pell-multipart/pom.xml
+++ b/plugins/pell-multipart/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-pell-multipart-plugin</artifactId>
diff --git a/plugins/plexus/pom.xml b/plugins/plexus/pom.xml
index dc73f0761..8070a02eb 100644
--- a/plugins/plexus/pom.xml
+++ b/plugins/plexus/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-plexus-plugin</artifactId>
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 886b03e2a..09224dd53 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-plugins</artifactId>
diff --git a/plugins/portlet-tiles/pom.xml b/plugins/portlet-tiles/pom.xml
index e79993375..0f8b58d94 100644
--- a/plugins/portlet-tiles/pom.xml
+++ b/plugins/portlet-tiles/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-portlet-tiles-plugin</artifactId>
diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml
index f9069827c..639d777d2 100644
--- a/plugins/portlet/pom.xml
+++ b/plugins/portlet/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-portlet-plugin</artifactId>
diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml
index 1c82be6b5..85505e22c 100644
--- a/plugins/rest/pom.xml
+++ b/plugins/rest/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-rest-plugin</artifactId>
diff --git a/plugins/sitegraph/pom.xml b/plugins/sitegraph/pom.xml
index e95fedeab..cbd95547c 100644
--- a/plugins/sitegraph/pom.xml
+++ b/plugins/sitegraph/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-sitegraph-plugin</artifactId>
diff --git a/plugins/sitemesh/pom.xml b/plugins/sitemesh/pom.xml
index fe221803f..aa491806a 100644
--- a/plugins/sitemesh/pom.xml
+++ b/plugins/sitemesh/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-sitemesh-plugin</artifactId>
diff --git a/plugins/spring/pom.xml b/plugins/spring/pom.xml
index 4c804f262..0af619abf 100644
--- a/plugins/spring/pom.xml
+++ b/plugins/spring/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-spring-plugin</artifactId>
diff --git a/plugins/testng/pom.xml b/plugins/testng/pom.xml
index 3d0f8eef0..b580702c4 100644
--- a/plugins/testng/pom.xml
+++ b/plugins/testng/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-testng-plugin</artifactId>
diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 7f21a1f6c..e48a75389 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
</parent>
<artifactId>struts2-tiles-plugin</artifactId>
diff --git a/pom.xml b/pom.xml
index 6fed88283..fd4d68893 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-parent</artifactId>
- <version>2.5.33-SNAPSHOT</version>
+ <version>2.5.33</version>
<packaging>pom</packaging>
<name>Struts 2</name>
<url>http://struts.apache.org/</url>
@@ -51,7 +51,7 @@
<connection>scm:git:https://gitbox.apache.org/repos/asf/struts.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/struts.git</developerConnection>
<url>https://github.com/apache/struts/</url>
- <tag>STRUTS_2_5_27</tag>
+ <tag>STRUTS_2_5_33</tag>
</scm>
<issueManagement>
@@ -96,7 +96,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.build.outputTimestamp>2023-09-11T06:17:21Z</project.build.outputTimestamp>
+ <project.build.outputTimestamp>2023-12-05T06:39:14Z</project.build.outputTimestamp>
<!-- Dependencies -->
<ognl.version>3.1.29</ognl.version>
(struts) 01/02: Makes HttpParameters case-insensitive
Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch release/struts-2-5-x
in repository https://gitbox.apache.org/repos/asf/struts.git
commit 162e29fee9136f4bfd9b2376da2cbf590f9ea163
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Mon Dec 4 06:45:16 2023 +0100
Makes HttpParameters case-insensitive
---
.../apache/struts2/dispatcher/HttpParameters.java | 47 +++++++++++++---
.../struts2/dispatcher/HttpParametersTest.java | 65 ++++++++++++++++++++++
2 files changed, 104 insertions(+), 8 deletions(-)
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/HttpParameters.java b/core/src/main/java/org/apache/struts2/dispatcher/HttpParameters.java
index d96614205..68d7e14db 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/HttpParameters.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/HttpParameters.java
@@ -25,13 +25,14 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
@SuppressWarnings("unchecked")
-public class HttpParameters implements Map<String, Parameter>, Cloneable {
+public class HttpParameters implements Map<String, Parameter> {
private Map<String, Parameter> parameters;
@@ -39,6 +40,7 @@ public class HttpParameters implements Map<String, Parameter>, Cloneable {
this.parameters = parameters;
}
+ @SuppressWarnings("rawtypes")
public static Builder create(Map requestParameterMap) {
return new Builder(requestParameterMap);
}
@@ -49,7 +51,15 @@ public class HttpParameters implements Map<String, Parameter>, Cloneable {
public HttpParameters remove(Set<String> paramsToRemove) {
for (String paramName : paramsToRemove) {
- parameters.remove(paramName);
+ String paramNameLowerCase = paramName.toLowerCase();
+ Iterator<Entry<String, Parameter>> iterator = parameters.entrySet().iterator();
+
+ while (iterator.hasNext()) {
+ Map.Entry<String, Parameter> entry = iterator.next();
+ if (entry.getKey().equalsIgnoreCase(paramNameLowerCase)) {
+ iterator.remove();
+ }
+ }
}
return this;
}
@@ -61,7 +71,17 @@ public class HttpParameters implements Map<String, Parameter>, Cloneable {
}
public boolean contains(String name) {
- return parameters.containsKey(name);
+ boolean found = false;
+ String nameLowerCase = name.toLowerCase();
+
+ for (String key : parameters.keySet()) {
+ if (key.equalsIgnoreCase(nameLowerCase)) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
}
/**
@@ -78,7 +98,14 @@ public class HttpParameters implements Map<String, Parameter>, Cloneable {
return result;
}
+ /**
+ * Appends all the parameters by overriding any existing params in a case-insensitive manner
+ *
+ * @param newParams A new params to append
+ * @return a current instance of {@link HttpParameters}
+ */
public HttpParameters appendAll(Map<String, Parameter> newParams) {
+ remove(newParams.keySet());
parameters.putAll(newParams);
return this;
}
@@ -109,11 +136,15 @@ public class HttpParameters implements Map<String, Parameter>, Cloneable {
@Override
public Parameter get(Object key) {
- if (parameters.containsKey(key)) {
- return parameters.get(key);
- } else {
- return new Parameter.Empty(String.valueOf(key));
+ if (key != null && contains(String.valueOf(key))) {
+ String keyString = String.valueOf(key).toLowerCase();
+ for (Map.Entry<String, Parameter> entry : parameters.entrySet()) {
+ if (entry.getKey() != null && entry.getKey().equalsIgnoreCase(keyString)) {
+ return entry.getValue();
+ }
+ }
}
+ return new Parameter.Empty(String.valueOf(key));
}
@Override
@@ -206,7 +237,7 @@ public class HttpParameters implements Map<String, Parameter>, Cloneable {
* Alternate Builder method which avoids wrapping any parameters that are already
* a {@link Parameter} element within another {@link Parameter} wrapper.
*
- * @return
+ * @return
*/
public HttpParameters buildNoNestedWrapping() {
Map<String, Parameter> parameters = (parent == null)
diff --git a/core/src/test/java/org/apache/struts2/dispatcher/HttpParametersTest.java b/core/src/test/java/org/apache/struts2/dispatcher/HttpParametersTest.java
new file mode 100644
index 000000000..7c2efbc12
--- /dev/null
+++ b/core/src/test/java/org/apache/struts2/dispatcher/HttpParametersTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.dispatcher;
+
+import org.junit.Test;
+
+import java.util.HashMap;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class HttpParametersTest {
+
+ @Test
+ public void shouldGetBeCaseInsensitive() {
+ // given
+ HttpParameters params = HttpParameters.create(new HashMap<String, Object>() {{
+ put("param1", "value1");
+ }}).build();
+
+ // then
+ assertEquals("value1", params.get("Param1").getValue());
+ assertEquals("value1", params.get("paraM1").getValue());
+ assertEquals("value1", params.get("pAraM1").getValue());
+ }
+
+ @Test
+ public void shouldAppendSameParamsIgnoringCase() {
+ // given
+ HttpParameters params = HttpParameters.create(new HashMap<String, Object>() {{
+ put("param1", "value1");
+ }}).build();
+
+ // when
+ assertEquals("value1", params.get("param1").getValue());
+
+ params = params.appendAll(HttpParameters.create(new HashMap<String, String>() {{
+ put("Param1", "Value1");
+ }}).build());
+
+ // then
+ assertTrue(params.contains("param1"));
+ assertTrue(params.contains("Param1"));
+
+ assertEquals("Value1", params.get("param1").getValue());
+ assertEquals("Value1", params.get("Param1").getValue());
+ }
+
+}
\ No newline at end of file