From b0b6998a71452d229afaae570c3396906c7432b3 Mon Sep 17 00:00:00 2001 From: RBRi Date: Mon, 1 May 2023 14:04:24 +0200 Subject: [PATCH] [htmlunit] don't report non existing linked resources as error (#10194) --- .../src/main/java/ossfuzz/HtmlParserFuzzer.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java b/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java index a02aabc6e..4d571960f 100644 --- a/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java +++ b/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java @@ -46,11 +46,10 @@ public class HtmlParserFuzzer { void test() { try (WebClient webClient = new WebClient(getBrowserVersion())) { - /* - * net.sourceforge.htmlunit.corejs.javascript.EvaluatorException - * seems to be fatal - */ + // org.htmlunit.corejs.javascript.EvaluatorException seems to be fatal webClient.getOptions().setThrowExceptionOnScriptError(false); + // no exception if linked resources are not available + webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.loadHtmlCodeIntoCurrentWindow(fuzzedDataProvider.consumeRemainingAsString()); } catch (IllegalArgumentException e) {