|
|
@ -22,8 +22,10 @@ import org.springframework.context.EnvironmentAware;
|
|
|
|
import org.springframework.core.env.ConfigurableEnvironment;
|
|
|
|
import org.springframework.core.env.ConfigurableEnvironment;
|
|
|
|
import org.springframework.core.env.EnumerablePropertySource;
|
|
|
|
import org.springframework.core.env.EnumerablePropertySource;
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
|
|
|
import org.springframework.core.env.PropertyResolver;
|
|
|
|
import org.springframework.core.env.PropertySource;
|
|
|
|
import org.springframework.core.env.PropertySource;
|
|
|
|
import org.springframework.core.env.PropertySources;
|
|
|
|
import org.springframework.core.env.PropertySources;
|
|
|
|
|
|
|
|
import org.springframework.core.env.PropertySourcesPropertyResolver;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
@ -93,7 +95,14 @@ public class EnvironmentMvcEndpoint extends EndpointMvcAdapter
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected Object getOptionalValue(Environment source, String name) {
|
|
|
|
protected Object getOptionalValue(Environment source, String name) {
|
|
|
|
Object result = source.getProperty(name);
|
|
|
|
PropertyResolver resolver = source;
|
|
|
|
|
|
|
|
if (source instanceof ConfigurableEnvironment) {
|
|
|
|
|
|
|
|
resolver = new PropertySourcesPropertyResolver(
|
|
|
|
|
|
|
|
((ConfigurableEnvironment) source).getPropertySources());
|
|
|
|
|
|
|
|
((PropertySourcesPropertyResolver) resolver)
|
|
|
|
|
|
|
|
.setIgnoreUnresolvableNestedPlaceholders(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object result = resolver.getProperty(name);
|
|
|
|
if (result != null) {
|
|
|
|
if (result != null) {
|
|
|
|
result = ((EnvironmentEndpoint) getDelegate()).sanitize(name, result);
|
|
|
|
result = ((EnvironmentEndpoint) getDelegate()).sanitize(name, result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|