}
if (requestMappingPatterns.contains(pattern.substring(0, pattern.length() - 1))) {
ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromRequest(request);
String path = builder.build().getPath();
builder.replacePath(path.substring(0, path.length() - 1));
String location = builder.build().toString();
response.setStatus(HttpStatus.MOVED_PERMANENTLY.value());
response.setHeader("Location", location);
return false;