Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ private Object executeRequest(final ResourceMethod rm,
switch (param.getType()) {
case PATH:
Args.check(paramValue != null, "Path parameter '%s' must not be null", param.getName());
Args.check(!".".equals(paramValue) && !"..".equals(paramValue),
"Path parameter '%s' must not be a '.' or '..' segment", param.getName());
pathParams.put(paramName, paramValue);
break;
case QUERY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,14 @@ void testNullPathParamThrows() {
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> api.echoPath(null));
}

@Test
void testDotSegmentPathParamThrows() {
final EchoPathApi api = proxy(EchoPathApi.class);
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> api.echoPath(".."));
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> api.echoPath("."));
assertThat(api.echoPath("..a")).isEqualTo("..a");
}

@Test
void testQueryParamSpaceEncodedAsPercent20() {
final EchoApi api = proxy(EchoApi.class);
Expand Down
Loading