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
20f201b5
Commit
20f201b5
authored
Mar 24, 2017
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flip default for management.add-application-context-header
Closes gh-8656
parent
28a5ffcc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
+9
-8
EndpointWebMvcAutoConfiguration.java
...ctuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
+1
-1
ManagementServerProperties.java
...oot/actuate/autoconfigure/ManagementServerProperties.java
+1
-1
EndpointWebMvcAutoConfigurationTests.java
...e/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
+6
-6
ManagementServerPropertiesTests.java
...ctuate/autoconfigure/ManagementServerPropertiesTests.java
+1
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
View file @
20f201b5
...
...
@@ -238,7 +238,7 @@ public class EndpointWebMvcAutoConfiguration
// Put Servlets and Filters in their own nested class so they don't force early
// instantiation of ManagementServerProperties.
@Configuration
@ConditionalOnProperty
(
prefix
=
"management"
,
name
=
"add-application-context-header"
,
matchIfMissing
=
true
,
havingValue
=
"true"
)
@ConditionalOnProperty
(
prefix
=
"management"
,
name
=
"add-application-context-header"
,
havingValue
=
"true"
)
protected
static
class
ApplicationContextFilterConfiguration
{
@Bean
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java
View file @
20f201b5
...
...
@@ -84,7 +84,7 @@ public class ManagementServerProperties implements SecurityPrerequisite {
/**
* Add the "X-Application-Context" HTTP header in each response.
*/
private
boolean
addApplicationContextHeader
=
tru
e
;
private
boolean
addApplicationContextHeader
=
fals
e
;
private
final
Security
security
=
new
Security
();
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
View file @
20f201b5
...
...
@@ -146,22 +146,22 @@ public class EndpointWebMvcAutoConfigurationTests {
assertContent
(
"/controller"
,
ports
.
get
().
management
,
null
);
assertContent
(
"/endpoint"
,
ports
.
get
().
management
,
null
);
assertThat
(
hasHeader
(
"/endpoint"
,
ports
.
get
().
server
,
"X-Application-Context"
))
.
is
Tru
e
();
.
is
Fals
e
();
assertThat
(
this
.
applicationContext
.
containsBean
(
"applicationContextIdFilter"
))
.
is
Tru
e
();
.
is
Fals
e
();
}
@Test
public
void
onSamePortWith
out
Header
()
throws
Exception
{
public
void
onSamePortWithHeader
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
applicationContext
,
"management.add-application-context-header:
fals
e"
);
"management.add-application-context-header:
tru
e"
);
this
.
applicationContext
.
register
(
RootConfig
.
class
,
EndpointConfig
.
class
,
BaseConfiguration
.
class
,
EndpointWebMvcAutoConfiguration
.
class
);
this
.
applicationContext
.
refresh
();
assertThat
(
hasHeader
(
"/endpoint"
,
ports
.
get
().
server
,
"X-Application-Context"
))
.
is
Fals
e
();
.
is
Tru
e
();
assertThat
(
this
.
applicationContext
.
containsBean
(
"applicationContextIdFilter"
))
.
is
Fals
e
();
.
is
Tru
e
();
}
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesTests.java
View file @
20f201b5
...
...
@@ -47,6 +47,7 @@ public class ManagementServerPropertiesTests {
ManagementServerProperties
properties
=
new
ManagementServerProperties
();
assertThat
(
properties
.
getPort
()).
isNull
();
assertThat
(
properties
.
getContextPath
()).
isEqualTo
(
""
);
assertThat
(
properties
.
getAddApplicationContextHeader
()).
isEqualTo
(
false
);
}
@Test
...
...
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