Browse Source

Merge pull request 'Patch 1.9.3' (#31) from qbcode into master

Reviewed-on: https://git.pott.app/KaffeePott/Barista-Server/pulls/31
tags/v1.9.3_ASIATICO
epileptic 10 months ago
parent
commit
93566d2999
3 changed files with 14 additions and 3 deletions
  1. +4
    -1
      src/app/pott/kaffeepott/barista/Constants.java
  2. +4
    -1
      src/app/pott/kaffeepott/barista/api/Api.java
  3. +6
    -1
      src/app/pott/kaffeepott/barista/reporter/Reporter.java

+ 4
- 1
src/app/pott/kaffeepott/barista/Constants.java View File

@@ -6,7 +6,7 @@ public final class Constants {
public static final String DEFAULT_QUERY_LOCALE = "en";

public static final class Version {
public static final String VERSION_MMP = "beta_1.9.2_build.1";
public static final String VERSION_MMP = "1.9.3";
public static final boolean IS_BETA = VERSION_MMP.toLowerCase().contains("beta");
public static final String VERSION_STATE = "ASIATICO";
public static final String VERSION_STRING = "v" + VERSION_MMP + "_" + VERSION_STATE;
@@ -80,6 +80,9 @@ public final class Constants {

public static final String NGINX_REAL_IP_HEADER = "X-Real-IP";

public static final String CONTENT_MIME_HEADER_KEY = "Content-Type";
public static final String CONTENT_MIME_HEADER_JSON_VALUE = "application/json";

public static final String GET_METHOD = "GET";
}



+ 4
- 1
src/app/pott/kaffeepott/barista/api/Api.java View File

@@ -65,6 +65,9 @@ public class Api extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

// Set JSON mime
response.setHeader(Http.CONTENT_MIME_HEADER_KEY, Http.CONTENT_MIME_HEADER_JSON_VALUE);

// Parameter to list
ArrayList<String> params = new ArrayList<String>();
Enumeration<String> paramsEnum = request.getParameterNames();
@@ -72,7 +75,7 @@ public class Api extends HttpServlet {
String c = paramsEnum.nextElement();
params.add(c);
}
// Get real ip
String realIp = request.getHeader(Http.NGINX_REAL_IP_HEADER);



+ 6
- 1
src/app/pott/kaffeepott/barista/reporter/Reporter.java View File

@@ -67,6 +67,10 @@ public class Reporter extends HttpServlet {

protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

// Set JSON mime
response.setHeader(Http.CONTENT_MIME_HEADER_KEY, Http.CONTENT_MIME_HEADER_JSON_VALUE);

if (cfg != null)
try {
String reportRaw = request.getParameter(Http.REPORT);
@@ -81,7 +85,8 @@ public class Reporter extends HttpServlet {
int versionCode = args.getInt(JsonKey.APP_VERSION_KEY);

// Get count of specific stacktrace
ResultSet checkResult = db.query(Reporters.CHECK_FOR_DUPLICATE, stacktrace, thread, apiLevel, versionCode);
ResultSet checkResult = db.query(Reporters.CHECK_FOR_DUPLICATE, stacktrace, thread, apiLevel,
versionCode);
checkResult.next();

if (checkResult.getInt(1) == 0 && versionCode >= currentVersion) {


Loading…
Cancel
Save