Commit be9291a3 authored by Madhura Bhave's avatar Madhura Bhave

Match trailing slash in actuator endpoints

Fixes gh-11024
parent c29fe057
......@@ -149,7 +149,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping
private PatternsRequestCondition patternsRequestConditionForPattern(String path) {
String[] patterns = new String[] { this.endpointMapping.createSubPath(path) };
return new PatternsRequestCondition(patterns, null, null, false, false);
return new PatternsRequestCondition(patterns, null, null, false, true);
}
private String[] toStringArray(Collection<String> collection) {
......
......@@ -122,6 +122,13 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
(client) -> client.get().uri("").exchange().expectStatus().isNotFound());
}
@Test
public void operationWithTrailingSlashShouldMatch() {
load(TestEndpointConfiguration.class,
(client) -> client.get().uri("/test/").exchange().expectStatus().isOk()
.expectBody().jsonPath("All").isEqualTo(true));
}
@Test
public void readOperationWithSingleQueryParameters() {
load(QueryEndpointConfiguration.class,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment