Skip to content

Commit d03bf13

Browse files
committed
Replace deprecated code in targeted script
Use the requester add-on to display the message in the editor dialogue. Needs zaproxy/zap-extensions#5542. Signed-off-by: thc202 <thc202@gmail.com>
1 parent 2d00941 commit d03bf13

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4343
- passive/RPO.js
4444
- passive/s3.js
4545
- httpsender/Alert on Unexpected Content Types.js now checks for common content-types (`json`, `xml`, and `yaml`) more consistently.
46+
- targeted/request_to_xml.js no longer uses deprecated method to show the message in the editor dialogue.
4647

4748
## [18] - 2024-01-29
4849
### Added

targeted/request_to_xml.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// rule1: pure JSON , no CODE
1313
// rule2: correct body (make edits only after conversion)
1414

15+
var requester = control.getExtensionLoader().getExtension("ExtensionRequester");
16+
1517
function invokeWith(msg) {
1618
var body = '<?xml version="1.0" encoding="UTF-8"?>\n';
1719
var reqb = msg.getRequestBody().toString();
@@ -37,10 +39,7 @@ function invokeWith(msg) {
3739
body.length
3840
);
3941
msg.setRequestHeader(header);
40-
var ext = new org.parosproxy.paros.extension.history.ExtensionHistory();
41-
var man = ext.getResendDialog();
42-
man.setMessage(msg.cloneRequest());
43-
man.setVisible(true);
42+
requester.displayMessage(msg.cloneRequest());
4443
}
4544

4645
function isJson(str) {

0 commit comments

Comments
 (0)