Gitlab Community Edition Instance

Commit c9a8d508 authored by mhellka's avatar mhellka
Browse files

Fix: UriBuilder not producing correct query strings

parent ad6581cc
......@@ -54,6 +54,8 @@ public class UriBuilder {
public UriBuilder path(String ... parts) {
if(parts.length == 0)
path.setLength(0);
if(path.length() > 0 && path.charAt(path.length()-1) == '/')
path.setLength(path.length()-1);
for(var part: parts)
path.append("/").append(URLEncoder.encode(part, StandardCharsets.UTF_8).replace("+", "%20"));
return this;
......@@ -69,7 +71,7 @@ public class UriBuilder {
query.append("&");
query.append(URLEncoder.encode(key, StandardCharsets.UTF_8));
if(value != null)
query.append("=").append(URLEncoder.encode(key, StandardCharsets.UTF_8));
query.append("=").append(URLEncoder.encode(value, StandardCharsets.UTF_8));
return this;
}
......
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