This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 78e363931c Complete fix for BZ 69285. Optimize creation of ParameterMap
78e363931c is described below
commit 78e363931c2629882aa48c8a1c6ccb15fe37a28c
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 d7ba8ea25a..ce3baffd17 100644
--- a/java/org/apache/catalina/core/ApplicationHttpRequest.java
+++ b/java/org/apache/catalina/core/ApplicationHttpRequest.java
@@ -735,7 +735,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 797d83a558..9379414eaf 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -160,6 +160,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]