fix new line in redact (#6035)

This commit is contained in:
Anthony Stirling
2026-04-01 11:58:38 +01:00
committed by GitHub
parent 0a098cf7b7
commit ecd1d3cad3

View File

@@ -159,10 +159,13 @@ public class SecurityConfiguration {
firewall.setAllowedHeaderValues(
headerValue -> headerValue != null && allowedChars.matcher(headerValue).matches());
// Apply the same rules to parameter values for consistency.
// Allow non-ASCII characters and newlines in parameter values.
Pattern allowedParamChars =
Pattern.compile("[\\p{IsAssigned}&&[^\\p{IsControl}]\\r\\n]*");
firewall.setAllowedParameterValues(
parameterValue ->
parameterValue != null && allowedChars.matcher(parameterValue).matches());
parameterValue != null
&& allowedParamChars.matcher(parameterValue).matches());
return firewall;
}