Merge branch '5.1.x'

master
Juergen Hoeller 5 years ago
commit c329bad42a
  1. 6
      spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java
  2. 7
      spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java

@ -100,9 +100,9 @@ public class DeferredResult<T> {
* @param timeoutValue timeout value in milliseconds (ignored if {@code null}) * @param timeoutValue timeout value in milliseconds (ignored if {@code null})
* @param timeoutResult the result to use * @param timeoutResult the result to use
*/ */
public DeferredResult(@Nullable Long timeoutValue, final Object timeoutResult) { public DeferredResult(@Nullable Long timeoutValue, Object timeoutResult) {
this.timeoutResult = () -> timeoutResult;
this.timeoutValue = timeoutValue; this.timeoutValue = timeoutValue;
this.timeoutResult = () -> timeoutResult;
} }
/** /**
@ -113,8 +113,8 @@ public class DeferredResult<T> {
* @since 5.1.1 * @since 5.1.1
*/ */
public DeferredResult(@Nullable Long timeoutValue, Supplier<?> timeoutResult) { public DeferredResult(@Nullable Long timeoutValue, Supplier<?> timeoutResult) {
this.timeoutResult = timeoutResult;
this.timeoutValue = timeoutValue; this.timeoutValue = timeoutValue;
this.timeoutResult = timeoutResult;
} }

@ -68,11 +68,12 @@ import org.springframework.web.util.WebUtils;
*/ */
public abstract class AbstractSockJsService implements SockJsService, CorsConfigurationSource { public abstract class AbstractSockJsService implements SockJsService, CorsConfigurationSource {
private static final String XFRAME_OPTIONS_HEADER = "X-Frame-Options";
private static final long ONE_YEAR = TimeUnit.DAYS.toSeconds(365); private static final long ONE_YEAR = TimeUnit.DAYS.toSeconds(365);
private static final Random random = new Random();
private static final String XFRAME_OPTIONS_HEADER = "X-Frame-Options"; private static final Random random = new Random();
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
@ -291,7 +292,7 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
/** /**
* Return if automatic addition of CORS headers has been disabled. * Return if automatic addition of CORS headers has been disabled.
* @since 4.1.2 * @since 4.1.2
* @see #setSuppressCors(boolean) * @see #setSuppressCors
*/ */
public boolean shouldSuppressCors() { public boolean shouldSuppressCors() {
return this.suppressCors; return this.suppressCors;

Loading…
Cancel
Save