api/src/main/java/com/google/apphosting/utils/remoteapi/EE10RemoteApiServlet.java [207:235]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException {
    if (!checkIsValidRequest(req, res)) {
      return;
    }
    res.setContentType("application/octet-stream");
    Response.Builder response = Response.newBuilder();
    try {
      byte[] responseData = executeRequest(req);
      response.setResponse(ByteString.copyFrom(responseData));
      res.setStatus(200);
    } catch (Exception e) {
      log.warning("Caught exception while executing remote_api command:\n" + e);
      res.setStatus(200);
      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(byteStream);
      out.writeObject(e);
      out.close();
      byte[] serializedException = byteStream.toByteArray();
      response.setJavaException(ByteString.copyFrom(serializedException));
      if (e instanceof ApiProxy.ApplicationException) {
        ApiProxy.ApplicationException ae = (ApiProxy.ApplicationException) e;
        response
            .getApplicationErrorBuilder()
            .setCode(ae.getApplicationError())
            .setDetail(ae.getErrorDetail());
      }
    }
    response.build().writeTo(res.getOutputStream());
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



api/src/main/java/com/google/apphosting/utils/remoteapi/RemoteApiServlet.java [207:235]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException {
    if (!checkIsValidRequest(req, res)) {
      return;
    }
    res.setContentType("application/octet-stream");
    Response.Builder response = Response.newBuilder();
    try {
      byte[] responseData = executeRequest(req);
      response.setResponse(ByteString.copyFrom(responseData));
      res.setStatus(200);
    } catch (Exception e) {
      log.warning("Caught exception while executing remote_api command:\n" + e);
      res.setStatus(200);
      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(byteStream);
      out.writeObject(e);
      out.close();
      byte[] serializedException = byteStream.toByteArray();
      response.setJavaException(ByteString.copyFrom(serializedException));
      if (e instanceof ApiProxy.ApplicationException) {
        ApiProxy.ApplicationException ae = (ApiProxy.ApplicationException) e;
        response
            .getApplicationErrorBuilder()
            .setCode(ae.getApplicationError())
            .setDetail(ae.getErrorDetail());
      }
    }
    response.build().writeTo(res.getOutputStream());
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



