The current implementation suggests that the request's headers are not
expected to change. Hence, it's not necessary to copy them.
Furthermore, it might be costly to do so if there are many headers.
Instead, cache only the request's header names for method getHeaderNames.
Methods getHeader and getHeaders delegate to the respective methods of
request if the header name is not in FORWARDED_HEADER_NAMES. Otherwise,
they return null or an empty Enumeration respectively.
See gh-27466
@ -169,23 +166,26 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
@@ -169,23 +166,26 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
// Override header accessors to not expose forwarded headers
@ -193,19 +193,25 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
@@ -193,19 +193,25 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {