Skip to content

Commit

Permalink
secure
Browse files Browse the repository at this point in the history
  • Loading branch information
adam committed Mar 21, 2024
1 parent c2e5ed5 commit 53e778a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/src/main/java/com/adamcalculator/dynamicpack/Mod.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ protected static void addAllowedHosts(String host, Object requester) throws Exce
Out.securityWarning("# ");
Out.securityWarning("# Host: " + host);
Out.securityWarning("# Requester: " + requester);
Out.securityWarning("# StackTrace:");
Out.securityStackTrace();
Out.securityWarning("# ");
Out.securityWarning("===========================");

Expand Down
12 changes: 12 additions & 0 deletions common/src/main/java/com/adamcalculator/dynamicpack/util/Out.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,16 @@ public static void securityWarning(String s) {
public static void debug(String s) {
println("DEBUG: " + s);
}

/**
* Always enable! Ignore enable/disable
*/
public static void securityStackTrace() {
if (USE_SOUT) {
System.out.println("[dynamicpack] Stacktrace");
new Throwable("StackTrace printer").printStackTrace();
return;
}
LOGGER.error("No error. This is stacktrace printer", new Throwable("StackTrace printer"));
}
}

0 comments on commit 53e778a

Please sign in to comment.