mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-06 15:44:49 +08:00
Debug logs for WebAPI
This commit is contained in:
parent
99b265119f
commit
23dd0f37e7
@ -4,6 +4,7 @@
|
||||
*/
|
||||
package main.java.com.djrapitops.plan.systems.webserver;
|
||||
|
||||
import main.java.com.djrapitops.plan.Log;
|
||||
import main.java.com.djrapitops.plan.Plan;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.response.ForbiddenResponse;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.response.Response;
|
||||
@ -74,7 +75,14 @@ public class APIResponseHandler {
|
||||
return PageCache.loadPage(error, () -> new BadRequestResponse(error));
|
||||
}
|
||||
|
||||
return api.onResponse(Plan.getInstance(), variables);
|
||||
Log.debug(request.toString());
|
||||
Log.debug(requestBody);
|
||||
|
||||
Response response = api.onResponse(Plan.getInstance(), variables);
|
||||
|
||||
Log.debug(response.toString());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
private String readPOSTRequest(InputStream in) throws IOException {
|
||||
|
@ -33,7 +33,7 @@ public abstract class Response {
|
||||
|
||||
public String getResponse() {
|
||||
return header + "\r\n"
|
||||
+ "Content-Type: text/html;\r\n"
|
||||
+ "Content-Type: " + type + ";\r\n"
|
||||
+ "Content-Length: " + content.length() + "\r\n"
|
||||
+ "\r\n"
|
||||
+ content;
|
||||
@ -91,4 +91,9 @@ public abstract class Response {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return header + " | " + getResponse();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user