diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/RestSession.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/RestSession.java index 16f1c34a0d..2c21e22d90 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/RestSession.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/RestSession.java @@ -14,6 +14,8 @@ package com.google.gerrit.acceptance; +import static com.google.gerrit.httpd.restapi.RestApiServlet.JSON_MAGIC; + import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; @@ -37,7 +39,7 @@ public class RestSession { HttpGet get = new HttpGet("http://localhost:8080/a" + endPoint); HttpResponse response = getClient().execute(get); Reader reader = new InputStreamReader(response.getEntity().getContent()); - reader.skip(4); + reader.skip(JSON_MAGIC.length); return reader; } diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java index 32437fbf4c..0859117152 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/restapi/RestApiServlet.java @@ -132,7 +132,7 @@ public class RestApiServlet extends HttpServlet { * HTTP interface will need to always strip the first line of response data to * remove this magic header. */ - private static final byte[] JSON_MAGIC; + public static final byte[] JSON_MAGIC; static { JSON_MAGIC = ")]}'\n".getBytes(UTF_8);