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
cdae79da
Commit
cdae79da
authored
Feb 26, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache management port type in EndpointRequestMatcher
Closes gh-20329
parent
421fe77b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
EndpointRequest.java
...uate/autoconfigure/security/reactive/EndpointRequest.java
+6
-1
EndpointRequest.java
...tuate/autoconfigure/security/servlet/EndpointRequest.java
+6
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java
View file @
cdae79da
...
...
@@ -130,6 +130,8 @@ public final class EndpointRequest {
private
volatile
ServerWebExchangeMatcher
delegate
;
private
static
ManagementPortType
managementPortType
;
private
EndpointServerWebExchangeMatcher
(
boolean
includeLinks
)
{
this
(
Collections
.
emptyList
(),
Collections
.
emptyList
(),
includeLinks
);
}
...
...
@@ -231,7 +233,10 @@ public final class EndpointRequest {
static
boolean
isManagementContext
(
ServerWebExchange
exchange
)
{
ApplicationContext
applicationContext
=
exchange
.
getApplicationContext
();
if
(
ManagementPortType
.
get
(
applicationContext
.
getEnvironment
())
==
ManagementPortType
.
DIFFERENT
)
{
if
(
managementPortType
==
null
)
{
managementPortType
=
ManagementPortType
.
get
(
applicationContext
.
getEnvironment
());
}
if
(
managementPortType
==
ManagementPortType
.
DIFFERENT
)
{
if
(
applicationContext
.
getParent
()
==
null
)
{
return
false
;
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java
View file @
cdae79da
...
...
@@ -124,14 +124,18 @@ public final class EndpointRequest {
private
volatile
RequestMatcher
delegate
;
private
static
ManagementPortType
managementPortType
;
AbstractRequestMatcher
()
{
super
(
WebApplicationContext
.
class
);
}
@Override
protected
boolean
ignoreApplicationContext
(
WebApplicationContext
applicationContext
)
{
ManagementPortType
type
=
ManagementPortType
.
get
(
applicationContext
.
getEnvironment
());
return
type
==
ManagementPortType
.
DIFFERENT
if
(
managementPortType
==
null
)
{
managementPortType
=
ManagementPortType
.
get
(
applicationContext
.
getEnvironment
());
}
return
managementPortType
==
ManagementPortType
.
DIFFERENT
&&
!
WebServerApplicationContext
.
hasServerNamespace
(
applicationContext
,
"management"
);
}
...
...
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