Deprecate SockJsServiceRegistration#setSupressCors

SockJsServiceRegistration#setSupressCors name contains a typo. It is
now deprecated in favor of a correctly spelled method, setSuppressCors.

See gh-28853
This commit is contained in:
Marc Wrobel 2022-07-21 23:54:38 +02:00 committed by Stephane Nicoll
parent f7c32d3a0b
commit 1cc36e5be9
2 changed files with 14 additions and 1 deletions

View File

@ -251,8 +251,21 @@ public class SockJsServiceRegistration {
* SockJS requests.
* <p>The default value is "false".
* @since 4.1.2
* @deprecated as of 5.3.23, in favor of {@link #setSuppressCors(boolean)},
* to be removed in Spring Framework 6.0
*/
@Deprecated
public SockJsServiceRegistration setSupressCors(boolean suppressCors) {
return this.setSuppressCors(suppressCors);
}
/**
* This option can be used to disable automatic addition of CORS headers for
* SockJS requests.
* <p>The default value is "false".
* @since 4.1.2 (was named {@code setSupressCors} prior to 5.3.23)
*/
public SockJsServiceRegistration setSuppressCors(boolean suppressCors) {
this.suppressCors = suppressCors;
return this;
}

View File

@ -166,7 +166,7 @@ public class WebMvcStompWebSocketEndpointRegistrationTests {
WebMvcStompWebSocketEndpointRegistration registration =
new WebMvcStompWebSocketEndpointRegistration(new String[] {"/foo"}, this.handler, this.scheduler);
registration.withSockJS().setSupressCors(true);
registration.withSockJS().setSuppressCors(true);
MultiValueMap<HttpRequestHandler, String> mappings = registration.getMappings();
assertThat(mappings.size()).isEqualTo(1);