Skip to content
Merged
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
21 changes: 21 additions & 0 deletions zap/src/main/java/org/zaproxy/zap/ZAP.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.PrintStream;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Locale;
import org.apache.commons.io.output.NullOutputStream;
Expand Down Expand Up @@ -111,6 +112,26 @@ private static void setCustomErrStream() {
System.setErr(
new DelegatorPrintStream(System.err) {

private static final byte[] XML_PROLOG_ERROR =
"[Fatal Error] :1:1: Content is not allowed in prolog."
.getBytes(StandardCharsets.US_ASCII);
private static final int XML_PROLOG_ERROR_LEN = XML_PROLOG_ERROR.length;

@Override
public void write(byte[] buf, int off, int len) {
if (len >= XML_PROLOG_ERROR_LEN
&& Arrays.equals(
buf,
off,
XML_PROLOG_ERROR_LEN,
XML_PROLOG_ERROR,
0,
XML_PROLOG_ERROR_LEN)) {
return;
}
super.write(buf, off, len);
}

@Override
public void println(String x) {
if (x != null && x.startsWith("Multiplexing LAF")) {
Expand Down
Loading