Browse Source

Deprecate SockJsServiceRegistration#setSupressCors

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

See gh-28853
pull/28959/head
Marc Wrobel 4 years ago committed by Stephane Nicoll
parent
commit
1cc36e5be9
  1. 13
      spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java
  2. 2
      spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebMvcStompWebSocketEndpointRegistrationTests.java

13
spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java

@ -251,8 +251,21 @@ public class SockJsServiceRegistration { @@ -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;
}

2
spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebMvcStompWebSocketEndpointRegistrationTests.java

@ -166,7 +166,7 @@ public class WebMvcStompWebSocketEndpointRegistrationTests { @@ -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);

Loading…
Cancel
Save