Skip to content

Commit 03e4890

Browse files
committed
Merge branch '6.1.x' into 6.2.x
Closes gh-14346
2 parents ee73f29 + b855ccd commit 03e4890

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ private XXssConfig() {
823823
* replaced with "#". For example:
824824
*
825825
* <pre>
826-
* X-XSS-Protection: 1 ; mode=block
826+
* X-XSS-Protection: 1; mode=block
827827
* </pre>
828828
* @param headerValue the new header value
829829
* @since 5.8

config/src/test/java/org/springframework/security/config/web/server/HeaderSpecTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public void headersWhenXssProtectionValueEnabledThenXssProtectionWritten() {
320320

321321
@Test
322322
public void headersWhenXssProtectionValueEnabledModeBlockThenXssProtectionWritten() {
323-
this.expectedHeaders.set(XXssProtectionServerHttpHeadersWriter.X_XSS_PROTECTION, "1 ; mode=block");
323+
this.expectedHeaders.set(XXssProtectionServerHttpHeadersWriter.X_XSS_PROTECTION, "1; mode=block");
324324
// @formatter:off
325325
this.http.headers()
326326
.xssProtection()

web/src/main/java/org/springframework/security/web/header/writers/XXssProtectionHeaderWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void writeHeaders(HttpServletRequest request, HttpServletResponse respons
7474
* specify mode as blocked. The content will be replaced with "#". For example:
7575
*
7676
* <pre>
77-
* X-XSS-Protection: 1 ; mode=block
77+
* X-XSS-Protection: 1; mode=block
7878
* </pre>
7979
* @param headerValue the new header value
8080
* @throws IllegalArgumentException when headerValue is null
@@ -86,7 +86,7 @@ public void setHeaderValue(HeaderValue headerValue) {
8686
}
8787

8888
/**
89-
* The value of the x-xss-protection header. One of: "0", "1", "1 ; mode=block"
89+
* The value of the x-xss-protection header. One of: "0", "1", "1; mode=block"
9090
*
9191
* @author Daniel Garnier-Moiroux
9292
* @since 5.8

web/src/main/java/org/springframework/security/web/server/header/XXssProtectionServerHttpHeadersWriter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public Mono<Void> writeHttpHeaders(ServerWebExchange exchange) {
7373
* specify mode as blocked. The content will be replaced with "#". For example:
7474
*
7575
* <pre>
76-
* X-XSS-Protection: 1 ; mode=block
76+
* X-XSS-Protection: 1; mode=block
7777
* </pre>
7878
* @param headerValue the new headerValue
7979
* @throws IllegalArgumentException if headerValue is null
@@ -86,14 +86,14 @@ public void setHeaderValue(HeaderValue headerValue) {
8686
}
8787

8888
/**
89-
* The value of the x-xss-protection header. One of: "0", "1", "1 ; mode=block"
89+
* The value of the x-xss-protection header. One of: "0", "1", "1; mode=block"
9090
*
9191
* @author Daniel Garnier-Moiroux
9292
* @since 5.8
9393
*/
9494
public enum HeaderValue {
9595

96-
DISABLED("0"), ENABLED("1"), ENABLED_MODE_BLOCK("1 ; mode=block");
96+
DISABLED("0"), ENABLED("1"), ENABLED_MODE_BLOCK("1; mode=block");
9797

9898
private final String value;
9999

web/src/test/java/org/springframework/security/web/server/header/XXssProtectionServerHttpHeadersWriterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void writeHeadersWhenEnabledModeBlockThenWriteHeaders() {
8282
this.writer.writeHttpHeaders(this.exchange);
8383
assertThat(this.headers).hasSize(1);
8484
assertThat(this.headers.get(XXssProtectionServerHttpHeadersWriter.X_XSS_PROTECTION))
85-
.containsOnly("1 ; mode=block");
85+
.containsOnly("1; mode=block");
8686
}
8787

8888
}

0 commit comments

Comments
 (0)