Prevent erroneous "empty locations" log warnings
Update our `ResourceHttpRequestHandler` subclass so that the following warning is no longer displayed: "Locations list is empty. No resources will be served unless a custom ResourceResolver is configured as an alternative to PathResourceResolver." Fixes gh-6791
This commit is contained in:
parent
ca2b97b915
commit
3570f7730a
|
|
@ -106,6 +106,7 @@ public class LogFileMvcEndpoint extends AbstractMvcEndpoint {
|
|||
|
||||
Handler(Resource resource) {
|
||||
this.resource = resource;
|
||||
getLocations().add(resource);
|
||||
try {
|
||||
afterPropertiesSet();
|
||||
}
|
||||
|
|
@ -114,6 +115,11 @@ public class LogFileMvcEndpoint extends AbstractMvcEndpoint {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAllowedLocations() {
|
||||
this.getLocations().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Resource getResource(HttpServletRequest request) throws IOException {
|
||||
return this.resource;
|
||||
|
|
|
|||
Loading…
Reference in New Issue