Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
935199b6
Commit
935199b6
authored
May 16, 2021
by
weixsun
Committed by
Stephane Nicoll
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish AbstractServletWebServerFactory
See gh-26478
parent
d41fa134
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
21 deletions
+10
-21
AbstractServletWebServerFactory.java
...t/web/servlet/server/AbstractServletWebServerFactory.java
+10
-21
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java
View file @
935199b6
...
...
@@ -19,6 +19,7 @@ package org.springframework.boot.web.servlet.server;
import
java.io.File
;
import
java.net.URL
;
import
java.nio.charset.Charset
;
import
java.time.Duration
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
...
...
@@ -37,6 +38,7 @@ import javax.servlet.SessionCookieConfig;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.boot.context.properties.PropertyMapper
;
import
org.springframework.boot.web.server.AbstractConfigurableWebServerFactory
;
import
org.springframework.boot.web.server.MimeMappings
;
import
org.springframework.boot.web.servlet.ServletContextInitializer
;
...
...
@@ -317,27 +319,14 @@ public abstract class AbstractServletWebServerFactory extends AbstractConfigurab
private
void
configureSessionCookie
(
SessionCookieConfig
config
)
{
Session
.
Cookie
cookie
=
this
.
session
.
getCookie
();
if
(
cookie
.
getName
()
!=
null
)
{
config
.
setName
(
cookie
.
getName
());
}
if
(
cookie
.
getDomain
()
!=
null
)
{
config
.
setDomain
(
cookie
.
getDomain
());
}
if
(
cookie
.
getPath
()
!=
null
)
{
config
.
setPath
(
cookie
.
getPath
());
}
if
(
cookie
.
getComment
()
!=
null
)
{
config
.
setComment
(
cookie
.
getComment
());
}
if
(
cookie
.
getHttpOnly
()
!=
null
)
{
config
.
setHttpOnly
(
cookie
.
getHttpOnly
());
}
if
(
cookie
.
getSecure
()
!=
null
)
{
config
.
setSecure
(
cookie
.
getSecure
());
}
if
(
cookie
.
getMaxAge
()
!=
null
)
{
config
.
setMaxAge
((
int
)
cookie
.
getMaxAge
().
getSeconds
());
}
PropertyMapper
map
=
PropertyMapper
.
get
().
alwaysApplyingWhenNonNull
();
map
.
from
(
cookie:
:
getName
).
to
(
config:
:
setName
);
map
.
from
(
cookie:
:
getDomain
).
to
(
config:
:
setDomain
);
map
.
from
(
cookie:
:
getPath
).
to
(
config:
:
setPath
);
map
.
from
(
cookie:
:
getComment
).
to
(
config:
:
setComment
);
map
.
from
(
cookie:
:
getHttpOnly
).
to
(
config:
:
setHttpOnly
);
map
.
from
(
cookie:
:
getSecure
).
to
(
config:
:
setSecure
);
map
.
from
(
cookie:
:
getMaxAge
).
asInt
(
Duration:
:
getSeconds
).
to
(
config:
:
setMaxAge
);
}
private
Set
<
javax
.
servlet
.
SessionTrackingMode
>
unwrap
(
Set
<
Session
.
SessionTrackingMode
>
modes
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment