From e1fd9df7b958e6a53661849e9a2d1d58fff24f7c Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 23 Feb 2018 13:57:02 +0100 Subject: [PATCH] Fix usage of management.server.add-application-context-header Closes gh-12190 --- .../autoconfigure/web/server/ManagementServerProperties.java | 3 +-- .../servlet/ServletManagementContextAutoConfiguration.java | 4 ++-- .../src/main/asciidoc/appendix-application-properties.adoc | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) 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 82a16e21a0..7b5a887682 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 @@ -56,8 +56,7 @@ public class ManagementServerProperties implements SecurityPrerequisite { private Ssl ssl; /** - * Add the "X-Application-Context" HTTP header in each response. Requires a custom - * management.server.port. + * Add the "X-Application-Context" HTTP header in each response. */ private boolean addApplicationContextHeader = false; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java index 55310dcf48..34607d7f89 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementContextAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ public class ServletManagementContextAutoConfiguration { // 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", havingValue = "true") + @ConditionalOnProperty(prefix = "management.server", name = "add-application-context-header", havingValue = "true") protected static class ApplicationContextFilterConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 8b71c419a0..f6d93bb137 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1123,7 +1123,7 @@ content into your application. Rather, pick only the properties that you need. # ---------------------------------------- # MANAGEMENT HTTP SERVER ({sc-spring-boot-actuator-autoconfigure}/web/server/ManagementServerProperties.{sc-ext}[ManagementServerProperties]) - management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response. Requires a custom management.server.port. + management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response. management.server.address= # Network address to which the management endpoints should bind. Requires a custom management.server.port. 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. management.server.servlet.context-path= # Management endpoint context-path (for instance, `/management`). Requires a custom management.server.port.