Skip to content

Commit 651429c

Browse files
committed
fixup
1 parent 00fa9bc commit 651429c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

conjure-java-jaxrs-client/src/main/java/com/palantir/conjure/java/client/jaxrs/DialogueFeignClient.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,18 @@ public void renderPath(ListMultimap<String, String> params, UrlBuilder url) {
392392
if (queryParamsStart != -1) {
393393
String querySegments = trailing.substring(queryParamsStart + 1);
394394
for (String querySegment : QUERY_SPLITTER.split(querySegments)) {
395+
boolean isValid = false;
395396
int equalsIndex = querySegment.indexOf(QUERY_KEY_VALUE_SEPARATOR);
396397
if (equalsIndex > -1) {
397398
String key = querySegment.substring(0, equalsIndex);
398399
int valueStart = equalsIndex + 1;
399400
if (querySegment.indexOf(QUERY_KEY_VALUE_SEPARATOR, valueStart) == -1) {
400-
String value = querySegment.substring(valueStart);
401-
url.queryParam(urlDecode(key), urlDecode(value));
401+
isValid = true;
402+
url.queryParam(urlDecode(key), urlDecode(querySegment.substring(valueStart)));
402403
}
403-
} else {
404+
}
405+
406+
if (!isValid) {
404407
List<String> keyValuePair = QUERY_KEY_VALUE_SPLITTER.splitToList(querySegment);
405408
throw new SafeIllegalStateException(
406409
"Expected two parameters",

0 commit comments

Comments
 (0)