diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index 7b5a887682b..6ea068e6408 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -55,11 +55,6 @@ public class ManagementServerProperties implements SecurityPrerequisite { @NestedConfigurationProperty private Ssl ssl; - /** - * Add the "X-Application-Context" HTTP header in each response. - */ - private boolean addApplicationContextHeader = false; - /** * Returns the management port or {@code null} if the * {@link ServerProperties#getPort() server port} should be used. @@ -99,14 +94,6 @@ public class ManagementServerProperties implements SecurityPrerequisite { return this.servlet; } - public boolean getAddApplicationContextHeader() { - return this.addApplicationContextHeader; - } - - public void setAddApplicationContextHeader(boolean addApplicationContextHeader) { - this.addApplicationContextHeader = addApplicationContextHeader; - } - /** * Servlet properties. */ diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 7bfaaf6a0a9..659b89f13c3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1229,6 +1229,12 @@ "level": "error" } }, + { + "name": "management.server.add-application-context-header", + "type": "java.lang.Boolean", + "description": "Add the \"X-Application-Context\" HTTP header in each response.", + "defaultValue": false + }, { "name": "management.shell.auth.jaas.domain", "type": "java.lang.String", diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerPropertiesTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerPropertiesTests.java index b933a287544..33dbf6e2685 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerPropertiesTests.java @@ -33,7 +33,6 @@ public class ManagementServerPropertiesTests { ManagementServerProperties properties = new ManagementServerProperties(); assertThat(properties.getPort()).isNull(); assertThat(properties.getServlet().getContextPath()).isEqualTo(""); - assertThat(properties.getAddApplicationContextHeader()).isFalse(); } @Test