mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-08 18:41:37 +00:00
Fix session timeout default value
Update DEFAULT_SESSION_TIMEOUT to use TimeUnit.MINUTES.toSeconds(30)
rather than TimeUnit.SECONDS.toMinutes(30) which would always return
0.
See gh-2084
(cherry picked from commit b33bbd56)
This commit is contained in:
+2
-2
@@ -37,8 +37,8 @@ import org.springframework.util.Assert;
|
||||
public abstract class AbstractConfigurableEmbeddedServletContainer implements
|
||||
ConfigurableEmbeddedServletContainer {
|
||||
|
||||
private static final int DEFAULT_SESSION_TIMEOUT = (int) TimeUnit.SECONDS
|
||||
.toMinutes(30);
|
||||
private static final int DEFAULT_SESSION_TIMEOUT = (int) TimeUnit.MINUTES
|
||||
.toSeconds(30);
|
||||
|
||||
private String contextPath = "";
|
||||
|
||||
|
||||
+5
@@ -530,6 +530,11 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
||||
equalTo("test"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultSessionTimeout() throws Exception {
|
||||
assertThat(getFactory().getSessionTimeout(), equalTo(30 * 60));
|
||||
}
|
||||
|
||||
protected String getLocalUrl(String resourcePath) {
|
||||
return getLocalUrl("http", resourcePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user