Skip to content

Commit

Permalink
Complete fix for BZ 69285. Optimize creation of ParameterMap
Browse files Browse the repository at this point in the history
Based on sample code and test cases provided by John Engebretson
  • Loading branch information
markt-asf committed Jan 31, 2025
1 parent 5f9f1fb commit 78e3639
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion java/org/apache/catalina/core/ApplicationHttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,12 @@ void parseParameters() {
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;
Expand Down
5 changes: 5 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 78e3639

Please sign in to comment.