Skip to content

Commit e1fd9df

Browse files
committed
Fix usage of management.server.add-application-context-header
Closes gh-12190
1 parent 976a23d commit e1fd9df

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public class ManagementServerProperties implements SecurityPrerequisite {
5656
private Ssl ssl;
5757

5858
/**
59-
* Add the "X-Application-Context" HTTP header in each response. Requires a custom
60-
* management.server.port.
59+
* Add the "X-Application-Context" HTTP header in each response.
6160
*/
6261
private boolean addApplicationContextHeader = false;
6362

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public ManagementServletContext managementServletContext(
5555
// Put Servlets and Filters in their own nested class so they don't force early
5656
// instantiation of ManagementServerProperties.
5757
@Configuration
58-
@ConditionalOnProperty(prefix = "management", name = "add-application-context-header", havingValue = "true")
58+
@ConditionalOnProperty(prefix = "management.server", name = "add-application-context-header", havingValue = "true")
5959
protected static class ApplicationContextFilterConfiguration {
6060

6161
@Bean

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ content into your application. Rather, pick only the properties that you need.
11231123
# ----------------------------------------
11241124
11251125
# MANAGEMENT HTTP SERVER ({sc-spring-boot-actuator-autoconfigure}/web/server/ManagementServerProperties.{sc-ext}[ManagementServerProperties])
1126-
management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response. Requires a custom management.server.port.
1126+
management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response.
11271127
management.server.address= # Network address to which the management endpoints should bind. Requires a custom management.server.port.
11281128
management.server.port= # Management endpoint HTTP port (uses the same port as the application by default). Configure a different port to use management-specific SSL.
11291129
management.server.servlet.context-path= # Management endpoint context-path (for instance, `/management`). Requires a custom management.server.port.

0 commit comments

Comments
 (0)