Separate server properties for message and errors

Prior to this commit, there was a property server.error.include-details
that allowed configuration of the message and errors attributes in a
server error response.

This commit separates the control of the message and errors attributes
into two separate properties named server.error.include-message and
server.error.include-binding-errors. When the message attribute is
excluded from a servlet response, the value is changed from a
hard-coded text value to an empty value.

Fixes gh-20505
This commit is contained in:
Scott Frederick
2020-04-29 17:56:47 -05:00
parent 18a9a229b1
commit a30740f8d2
26 changed files with 379 additions and 246 deletions

View File

@@ -412,7 +412,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
contextCustomizer.accept(applicationContext);
Map<String, Object> properties = new HashMap<>();
properties.put("endpointPath", endpointPath);
properties.put("server.error.include-details", "always");
properties.put("server.error.include-message", "always");
applicationContext.getEnvironment().getPropertySources().addLast(new MapPropertySource("test", properties));
applicationContext.refresh();
try {