diff options
author | Matthias Sohn <matthias.sohn@gmail.com> | 2021-01-15 16:58:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-01-15 16:58:09 +0000 |
commit | 15e7a4499443be5a160f96e8d92c978713415734 (patch) | |
tree | 5926b0b9754721a2d03dbe9605d8d398edee9b92 | |
parent | a0b3200ebca6f45dc1362287f1f74876f62fdb0f (diff) | |
parent | 69b728ba958883dcfadf4512c088b2c27e1ecb8e (diff) |
Merge "Fix badly formatted error message shown in error dialog" into stable-3.1
-rw-r--r-- | java/com/google/gerrit/httpd/restapi/RestApiServlet.java | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/java/com/google/gerrit/httpd/restapi/RestApiServlet.java b/java/com/google/gerrit/httpd/restapi/RestApiServlet.java index a7c0e300fd..fe3621ed19 100644 --- a/java/com/google/gerrit/httpd/restapi/RestApiServlet.java +++ b/java/com/google/gerrit/httpd/restapi/RestApiServlet.java @@ -47,7 +47,6 @@ import static javax.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED; import static javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.CharMatcher; import com.google.common.base.Joiner; import com.google.common.base.Splitter; import com.google.common.base.Strings; @@ -134,7 +133,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonParseException; -import com.google.gson.JsonPrimitive; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; @@ -1549,10 +1547,6 @@ public class RestApiServlet extends HttpServlet { static long replyText( @Nullable HttpServletRequest req, HttpServletResponse res, boolean allowTracing, String text) throws IOException { - if ((req == null || isRead(req)) && isMaybeHTML(text)) { - return replyJson( - req, res, allowTracing, ImmutableListMultimap.of("pp", "0"), new JsonPrimitive(text)); - } if (!text.endsWith("\n")) { text += "\n"; } @@ -1562,10 +1556,6 @@ public class RestApiServlet extends HttpServlet { return replyBinaryResult(req, res, BinaryResult.create(text).setContentType(PLAIN_TEXT)); } - private static boolean isMaybeHTML(String text) { - return CharMatcher.anyOf("<&").matchesAnyOf(text); - } - private static boolean acceptsGzip(HttpServletRequest req) { if (req != null) { String accepts = req.getHeader(HttpHeaders.ACCEPT_ENCODING); |