Fix usage of management.server.add-application-context-header

Closes gh-12190
This commit is contained in:
Stephane Nicoll 2018-02-23 13:57:02 +01:00
parent 976a23d977
commit e1fd9df7b9
3 changed files with 4 additions and 5 deletions

View File

@ -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;

View File

@ -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

View File

@ -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.