This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new f5e2525309 Complete fix for BZ 69285. Optimize creation of ParameterMap
f5e2525309 is described below
commit f5e25253092381245a6d162cf9fe131f056e74ed
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Jan 31 11:56:13 2025 +0000
Complete fix for BZ 69285. Optimize creation of ParameterMap
Based on sample code and test cases provided by John Engebretson
---
java/org/apache/catalina/core/ApplicationHttpRequest.java | 7 ++++++-
webapps/docs/changelog.xml | 5 +++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/core/ApplicationHttpRequest.java
b/java/org/apache/catalina/core/ApplicationHttpRequest.java
index a176e6db7b..e78495e709 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -732,7 +732,12 @@ class ApplicationHttpRequest extends
HttpServletRequestWrapper {
return;
}
- parameters = new ParameterMap<>(getRequest().getParameterMap());
+ Map<String,String[]> requestParameters =
getRequest().getParameterMap();
+ if (requestParameters instanceof ParameterMap<String,String[]>) {
+ parameters = new ParameterMap<>((ParameterMap<String,String[]>)
requestParameters);
+ } else {
+ parameters = new ParameterMap<>(requestParameters);
+ }
mergeParameters();
((ParameterMap<String,String[]>) parameters).setLocked(true);
parsedParams = true;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2be174ee59..3e98154f19 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -123,6 +123,11 @@
attribute value will also be used by the default and WebDAV Servlets.
(remm)
</update>
+ <fix>
+ <bug>69285</bug>: Optimise the creation of the parameter map for
+ included requests. Based on sample code and test cases provided by John
+ Engebretson. (markt)
+ </fix>
<fix>
<bug>69527</bug>: Avoid rare cases where a cached resource could be set
with 0 content length, or could be evicted immediately. (remm)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]