You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XFrameOptionsHeaderWriter should not *add*, but *set* the
X-Frame-Options header. According to
https://tools.ietf.org/html/rfc7034#section-2.1, having
multiple values for the header is disallowed:
"There are three different values for the header field.
These values are mutually exclusive; that is, the header
field MUST be set to exactly one of the three values."
With this change, only the latest XFrameOptionsHeaderWriter
will remain.
Copy file name to clipboardExpand all lines: web/src/main/java/org/springframework/security/web/header/writers/frameoptions/XFrameOptionsHeaderWriter.java
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -74,16 +74,22 @@ public XFrameOptionsHeaderWriter(AllowFromStrategy allowFromStrategy) {
74
74
this.allowFromStrategy = allowFromStrategy;
75
75
}
76
76
77
+
/**
78
+
* Writes the X-Frame-Options header value, overwritting any previous value.
Copy file name to clipboardExpand all lines: web/src/test/java/org/springframework/security/web/header/writers/frameoptions/FrameOptionsHeaderWriterTests.java
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -108,4 +108,17 @@ public void writeHeadersSameOrigin() {
0 commit comments