Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/coreyd97/stepper/Globals.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ public class Globals {
public static final String PREF_VARS_IN_SPIDER = "enableVarsInSpider";
public static final String PREF_UPDATE_REQUEST_LENGTH = "updateRequestLength";
public static final String PREF_ENABLE_SHORTCUT = "enableShortcut";
public static final String PREF_ENABLE_UNPROCESSABLE_WARNING = "enableUnprocessableWarning";
}
13 changes: 7 additions & 6 deletions src/main/java/com/coreyd97/stepper/MessageProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequ
HashMap<StepSequence, List<StepVariable>> allVariables = sequenceManager.getRollingVariablesFromAllSequences();

if(allVariables.size() > 0 && hasStepVariable(request)) {

if(isUnprocessable(messageInfo.getRequest())){
if(isUnprocessable(messageInfo.getRequest()) && Stepper.getPreferences().getSetting(Globals.PREF_ENABLE_UNPROCESSABLE_WARNING).equals(true)){
//If there's unicode issues, we're likely acting on binary data. Warn the user.
//But only warn user if they did not disable this warning.
//In some cases, especially if Stepper is used together with Param Miner, these warnings can popup often
int result = JOptionPane.showConfirmDialog(Stepper.getUI().getUiComponent(),
"The request contains non UTF characters.\nStepper is able to make the replacements, " +
"but some of the binary data may be lost. Continue?",
"Stepper Replacement Error", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(result == JOptionPane.NO_OPTION) return;
"The request contains non UTF characters.\nStepper is able to make the replacements, " +
"but some of the binary data may be lost. Continue?",
"Stepper Replacement Error", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(result == JOptionPane.NO_OPTION) return;
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ protected void registerSettings() {
prefs.registerSetting(Globals.PREF_VARS_IN_SCANNER, Boolean.class, true, Preferences.Visibility.GLOBAL);
prefs.registerSetting(Globals.PREF_UPDATE_REQUEST_LENGTH, Boolean.class, true, Preferences.Visibility.GLOBAL);
prefs.registerSetting(Globals.PREF_ENABLE_SHORTCUT, Boolean.class, true, Preferences.Visibility.GLOBAL);
prefs.registerSetting(Globals.PREF_ENABLE_UNPROCESSABLE_WARNING, Boolean.class, true, Preferences.Visibility.GLOBAL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private void buildPanel() {
ComponentGroup configGroup = new ComponentGroup(ComponentGroup.Orientation.VERTICAL, "Config");
configGroup.addPreferenceComponent(preferences, Globals.PREF_UPDATE_REQUEST_LENGTH, "Automatically update the Content-Length header");
configGroup.addPreferenceComponent(preferences, Globals.PREF_ENABLE_SHORTCUT, "Enable Shortcut (Ctrl+Shift+G)");
configGroup.addPreferenceComponent(preferences, Globals.PREF_ENABLE_UNPROCESSABLE_WARNING, "Enable warning if non UTF-8 character in request");

ComponentGroup toolEnabledGroup = new ComponentGroup(ComponentGroup.Orientation.VERTICAL, "Allow Variables Usage");
JCheckBox allToolsCheckbox = toolEnabledGroup.addPreferenceComponent(preferences, Globals.PREF_VARS_IN_ALL_TOOLS, "All Tools");
Expand Down