I am trying to override an existing method in ESAPI OWASP library, by using ESAPI.override(). Somehow it does not work, do you know why?
Here my code:
public class AntiSamyDOMScannerExpansion extends AbstractAntiSamyScanner {
//...
public CleanResults scan(String html, String inputEncoding, String outputEncoding) throws ScanException {
ESAPI.override(new DefaultSecurityConfiguration());
//...
ESAPI.override()is used only to override the configuration. In order to expand other kind of methods, in my caseAntiSamy.scan, it is needed to extend every class in the call structure.This is because of a inflexible implementation. For instance we find in
HTMLValidationRule.java:Due to
AntiSamy as = new AntiSamy();we can not make it usable in a custom implementation.