-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added function to set the Rule Response in scripts. Removed Then Brea…
…k from being callable from scripts due to it not having effect in this context. Fix for using using lone variables tags in number based fields. Improved console.log/err printing in script.
- Loading branch information
Showing
8 changed files
with
55 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ case "`uname`" in | |
Darwin* ) | ||
darwin=true | ||
;; | ||
MINGW* ) | ||
MSYS* | MINGW* ) | ||
msys=true | ||
;; | ||
NONSTOP* ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
src/main/java/synfron/reshaper/burp/core/rules/thens/entities/script/ConsoleObj.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
package synfron.reshaper.burp.core.rules.thens.entities.script; | ||
|
||
import org.mozilla.javascript.ScriptableObject; | ||
import synfron.reshaper.burp.core.utils.Log; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Objects; | ||
import java.util.stream.Collectors; | ||
|
||
public class ConsoleObj { | ||
public void log(Object... args) { | ||
Log.get().withMessage("Script Log").withPayload(args.length == 1 ? args[0] : args).log(); | ||
List<Object> values = getConsoleWritable(args); | ||
Log.get().withMessage("Script Log").withPayload(values.size() == 1 ? values.get(0) : values).log(); | ||
} | ||
|
||
public void error(Object... args) { | ||
Log.get().withMessage("Script Log").withPayload(args.length == 1 ? args[0] : args).logErr(); | ||
List<Object> values = getConsoleWritable(args); | ||
Log.get().withMessage("Script Log").withPayload(values.size() == 1 ? values.get(0) : values).logErr(); | ||
} | ||
|
||
private List<Object> getConsoleWritable(Object[] values) { | ||
return Arrays.stream(values) | ||
.map(value -> value instanceof ScriptableObject ? Objects.toString(value) : value) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters