diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java
+++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java
@@ -71,6 +71,11 @@ public class ConfigServerMvcConfiguration implements WebMvcConfigurer {
 		@Bean
 		public EnvironmentController environmentController(EnvironmentRepository envRepository,
 				ConfigServerProperties server) {
+			return delegateController(envRepository, server);
+		}
+
+		protected EnvironmentController delegateController(EnvironmentRepository envRepository,
+				ConfigServerProperties server) {
 			EnvironmentController controller = new EnvironmentController(encrypted(envRepository, server),
 					this.objectMapper);
 			controller.setStripDocumentFromYaml(server.isStripDocumentFromYaml());
@@ -107,7 +112,7 @@ public class ConfigServerMvcConfiguration implements WebMvcConfigurer {
 		@RefreshScope
 		public EnvironmentController environmentController(EnvironmentRepository envRepository,
 				ConfigServerProperties server) {
-			return super.environmentController(envRepository, server);
+			return super.delegateController(envRepository, server);
 		}
 
 	}
Avoid triggering self-invocation warning inadvertently