Skip to content

Commit

Permalink
Do not strip trailing slashes when using Reactive REST Client
Browse files Browse the repository at this point in the history
Fixes: #27050
  • Loading branch information
geoand committed Aug 1, 2022
1 parent 18dcadb commit 94ee05e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class StorkResponseTimeLoadBalancerTest {
@BeforeAll
public static void setUp() {
server = new WireMockServer(options().port(8766));
server.stubFor(WireMock.post("/hello")
server.stubFor(WireMock.post("/hello/")
.willReturn(aResponse().withFixedDelay(1000)
.withBody(SLOW_RESPONSE).withStatus(200)));
server.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ protected List<ResourceMethod> createEndpoints(ClassInfo currentClassInfo,
methodPath = "/" + methodPath;
}
if (methodPath.endsWith("/")) {
methodPath = methodPath.substring(0, methodPath.length() - 1);
methodPath = handleTrailingSlash(methodPath);
}
} else {
methodPath = "";
Expand Down Expand Up @@ -451,6 +451,10 @@ protected List<ResourceMethod> createEndpoints(ClassInfo currentClassInfo,
return ret;
}

protected String handleTrailingSlash(String path) {
return path;
}

private void validateHttpAnnotations(MethodInfo info) {
List<AnnotationInstance> annotationInstances = info.annotations();
Set<DotName> allMethodAnnotations = new HashSet<>(annotationInstances.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,9 @@ protected void handleArrayParam(Map<String, String> existingConverters, String e
builder.setConverter(new ArrayConverter.ArraySupplier(converter, elementType));
}

protected void handlePathSegmentParam(ServerIndexedParameter builder) {
builder.setConverter(new PathSegmentParamConverter.Supplier());
@Override
protected String handleTrailingSlash(String path) {
return path.substring(0, path.length() - 1);
}

protected void handleTemporalParam(ServerIndexedParameter builder, DotName paramType,
Expand Down

0 comments on commit 94ee05e

Please sign in to comment.