Encode query string to fix problems of searching for issues with a whitespace in it.

This commit is contained in:
Bill Kachirsky 2020-02-27 01:54:52 -08:00
parent e5e3e84b23
commit 1f7fcd7d03

View File

@ -30,6 +30,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.InputStreamReader;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.Function;
@ -260,7 +261,7 @@ class GiteaRepository extends BaseRepositoryImpl {
StringBuilder qu = new StringBuilder();
if (query != null)
qu.append("?q=").append(query);
qu.append("?q=").append(URLEncoder.encode(query, "UTF-8"));
if (withClosed)
qu.append("&state=closed");
qu.append("&page=");