Skip to content

Commit 8d5304f

Browse files
Use function definition instead of arrow function expression
Closes gh-13106
1 parent e9a02bc commit 8d5304f

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/Saml2WebSsoAuthenticationRequestFilter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -231,7 +231,7 @@ private String createSamlPostRequestFormData(Saml2PostAuthenticationRequest auth
231231
html.append("<!DOCTYPE html>\n");
232232
html.append("<html>\n").append(" <head>\n");
233233
html.append(" <meta http-equiv=\"Content-Security-Policy\" ")
234-
.append("content=\"script-src 'sha256-t+jmhLjs1ocvgaHBJsFcgznRk68d37TLtbI3NE9h7EU='\">\n");
234+
.append("content=\"script-src 'sha256-oZhLbc2kO8b8oaYLrUc7uye1MgVKMyLtPqWR4WtKF+c='\">\n");
235235
html.append(" <meta charset=\"utf-8\" />\n");
236236
html.append(" </head>\n");
237237
html.append(" <body>\n");
@@ -262,7 +262,7 @@ private String createSamlPostRequestFormData(Saml2PostAuthenticationRequest auth
262262
html.append(" </noscript>\n");
263263
html.append(" </form>\n");
264264
html.append(" \n");
265-
html.append(" <script>window.onload = () => document.forms[0].submit();</script>\n");
265+
html.append(" <script>window.onload = function() { document.forms[0].submit(); }</script>\n");
266266
html.append(" </body>\n");
267267
html.append("</html>");
268268
return html.toString();

saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/authentication/logout/Saml2LogoutRequestFilter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -216,7 +216,7 @@ private String createSamlPostRequestFormData(String location, String saml, Strin
216216
html.append("<!DOCTYPE html>\n");
217217
html.append("<html>\n").append(" <head>\n");
218218
html.append(" <meta http-equiv=\"Content-Security-Policy\" ")
219-
.append("content=\"script-src 'sha256-t+jmhLjs1ocvgaHBJsFcgznRk68d37TLtbI3NE9h7EU='\">\n");
219+
.append("content=\"script-src 'sha256-oZhLbc2kO8b8oaYLrUc7uye1MgVKMyLtPqWR4WtKF+c='\">\n");
220220
html.append(" <meta charset=\"utf-8\" />\n");
221221
html.append(" </head>\n");
222222
html.append(" <body>\n");
@@ -247,7 +247,7 @@ private String createSamlPostRequestFormData(String location, String saml, Strin
247247
html.append(" </noscript>\n");
248248
html.append(" </form>\n");
249249
html.append(" \n");
250-
html.append(" <script>window.onload = () => document.forms[0].submit();</script>\n");
250+
html.append(" <script>window.onload = function() { document.forms[0].submit(); }</script>\n");
251251
html.append(" </body>\n");
252252
html.append("</html>");
253253
return html.toString();

saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/authentication/logout/Saml2RelyingPartyInitiatedLogoutSuccessHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -120,7 +120,7 @@ private String createSamlPostRequestFormData(String location, String saml, Strin
120120
html.append("<!DOCTYPE html>\n");
121121
html.append("<html>\n").append(" <head>\n");
122122
html.append(" <meta http-equiv=\"Content-Security-Policy\" ")
123-
.append("content=\"script-src 'sha256-t+jmhLjs1ocvgaHBJsFcgznRk68d37TLtbI3NE9h7EU='\">\n");
123+
.append("content=\"script-src 'sha256-oZhLbc2kO8b8oaYLrUc7uye1MgVKMyLtPqWR4WtKF+c='\">\n");
124124
html.append(" <meta charset=\"utf-8\" />\n");
125125
html.append(" </head>\n");
126126
html.append(" <body>\n");
@@ -151,7 +151,7 @@ private String createSamlPostRequestFormData(String location, String saml, Strin
151151
html.append(" </noscript>\n");
152152
html.append(" </form>\n");
153153
html.append(" \n");
154-
html.append(" <script>window.onload = () => document.forms[0].submit();</script>\n");
154+
html.append(" <script>window.onload = function() { document.forms[0].submit(); }</script>\n");
155155
html.append(" </body>\n");
156156
html.append("</html>");
157157
return html.toString();

saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/web/Saml2WebSsoAuthenticationRequestFilterTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -194,8 +194,8 @@ public void doFilterWhenPostFormDataIsPresent() throws Exception {
194194
this.filter.doFilterInternal(this.request, this.response, this.filterChain);
195195
assertThat(this.response.getHeader("Location")).isNull();
196196
assertThat(this.response.getContentAsString()).contains(
197-
"<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'sha256-t+jmhLjs1ocvgaHBJsFcgznRk68d37TLtbI3NE9h7EU='\">")
198-
.contains("<script>window.onload = () => document.forms[0].submit();</script>")
197+
"<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'sha256-oZhLbc2kO8b8oaYLrUc7uye1MgVKMyLtPqWR4WtKF+c='\">")
198+
.contains("<script>window.onload = function() { document.forms[0].submit(); }</script>")
199199
.contains("<form action=\"https://sso-url.example.com/IDP/SSO\" method=\"post\">")
200200
.contains("<input type=\"hidden\" name=\"SAMLRequest\"")
201201
.contains("value=\"" + relayStateEncoded + "\"");

saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/web/authentication/logout/Saml2LogoutRequestFilterTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -118,8 +118,8 @@ public void doFilterWhenSamlRequestThenPosts() throws Exception {
118118
assertThat(content).contains(Saml2ParameterNames.SAML_RESPONSE);
119119
assertThat(content).contains(registration.getAssertingPartyDetails().getSingleLogoutServiceResponseLocation());
120120
assertThat(content).contains(
121-
"<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'sha256-t+jmhLjs1ocvgaHBJsFcgznRk68d37TLtbI3NE9h7EU='\">");
122-
assertThat(content).contains("<script>window.onload = () => document.forms[0].submit();</script>");
121+
"<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'sha256-oZhLbc2kO8b8oaYLrUc7uye1MgVKMyLtPqWR4WtKF+c='\">");
122+
assertThat(content).contains("<script>window.onload = function() { document.forms[0].submit(); }</script>");
123123
verify(this.securityContextHolderStrategy).getContext();
124124
}
125125

saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/web/authentication/logout/Saml2RelyingPartyInitiatedLogoutSuccessHandlerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -98,8 +98,8 @@ public void onLogoutSuccessWhenPostThenPostsToAssertingParty() throws Exception
9898
assertThat(content).contains(Saml2ParameterNames.SAML_REQUEST);
9999
assertThat(content).contains(registration.getAssertingPartyDetails().getSingleLogoutServiceLocation());
100100
assertThat(content).contains(
101-
"<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'sha256-t+jmhLjs1ocvgaHBJsFcgznRk68d37TLtbI3NE9h7EU='\">");
102-
assertThat(content).contains("<script>window.onload = () => document.forms[0].submit();</script>");
101+
"<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'sha256-oZhLbc2kO8b8oaYLrUc7uye1MgVKMyLtPqWR4WtKF+c='\">");
102+
assertThat(content).contains("<script>window.onload = function() { document.forms[0].submit(); }</script>");
103103
}
104104

105105
private Saml2Authentication authentication(RelyingPartyRegistration registration) {

0 commit comments

Comments
 (0)