File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
web/src/main/java/org/springframework/security/web/firewall Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 16
16
package org .springframework .security .web .firewall ;
17
17
18
18
import java .io .IOException ;
19
- import java .util .regex .Pattern ;
20
19
21
20
import javax .servlet .http .Cookie ;
22
21
import javax .servlet .http .HttpServletResponse ;
26
25
* @author Luke Taylor
27
26
* @author Eddú Meléndez
28
27
* @author Gabriel Lavoie
28
+ * @author Luke Butters
29
29
*/
30
30
class FirewalledResponse extends HttpServletResponseWrapper {
31
- private static final Pattern CR_OR_LF = Pattern .compile ("\\ r|\\ n" );
32
31
private static final String LOCATION_HEADER = "Location" ;
33
32
private static final String SET_COOKIE_HEADER = "Set-Cookie" ;
34
33
@@ -76,6 +75,6 @@ void validateCrlf(String name, String value) {
76
75
}
77
76
78
77
private boolean hasCrlf (String value ) {
79
- return value != null && CR_OR_LF . matcher (value ). find ( );
78
+ return value != null && (value . indexOf ( '\n' ) != - 1 || value . indexOf ( '\r' ) != - 1 );
80
79
}
81
80
}
You can’t perform that action at this time.
0 commit comments