Skip to content

Commit

Permalink
Make Ruby passive template work again (#2439)
Browse files Browse the repository at this point in the history
ZAP complained about `appliesToHistoryType()` missing.

Signed-off-by: Anders K. Madsen <[email protected]>
  • Loading branch information
lillesvin authored Jun 11, 2020
1 parent 465f061 commit 24fdb78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions addOns/jruby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fix link in a script template.
- Fix exception while uninstalling the add-on with newer Java versions.
- Fix passive template.

## 6 - 2017-11-27

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'java'
java_package 'org.zaproxy.zap.extension.pscan'
java_import 'org.zaproxy.zap.extension.pscan.PassiveScript'
java_import 'org.zaproxy.zap.extension.pscan.PluginPassiveScanner'
java_import 'org.zaproxy.zap.extension.pscan.scanner.ScriptsPassiveScanner'
java_import 'org.parosproxy.paros.network.HttpMessage'
java_import 'net.htmlparser.jericho.Source'
Expand Down Expand Up @@ -35,5 +36,10 @@ def scan(ps, msg, src)
end
end

# Tells whether or not the scanner applies to the given history type.
def appliesToHistoryType(historyType)
PluginPassiveScanner.getDefaultHistoryTypes().include?(historyType);
end

# This is required - dont delete it or you'll break the script
JRubyPassiveScript.new
JRubyPassiveScript.new

0 comments on commit 24fdb78

Please sign in to comment.