Restore TomcatHeadersAdapter.clear() behavior

This commit restores the original behavior of the clear() method in
TomcatHeadersAdapter by delegating to
org.apache.tomcat.util.http.MimeHeaders.recycle(), which aligns with
the memory efficiency goals documented in the class-level Javadoc for
MimeHeaders.

See gh-33916
Closes gh-34092
This commit is contained in:
Sam Brannen
2024-12-15 15:34:49 +01:00
parent c8009dc67d
commit 8a8df90a46
2 changed files with 11 additions and 5 deletions
@@ -163,9 +163,7 @@ class TomcatHeadersAdapter implements MultiValueMap<String, String> {
@Override
public void clear() {
while (this.headers.size() > 0) {
this.headers.removeHeader(0);
}
this.headers.recycle();
}
@Override