From c0cf9acdead29394de86bbb527e4c7582d3596e4 Mon Sep 17 00:00:00 2001 From: Joseph Heenan Date: Sat, 12 Jun 2021 15:59:35 +0100 Subject: [PATCH] WIP: BrowserControl debug use strict comes from: https://github.com/HtmlUnit/htmlunit/issues/188 but appears to go wrong in gzipped results. --- .../conformance/frontChannel/BrowserControl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/net/openid/conformance/frontChannel/BrowserControl.java b/src/main/java/net/openid/conformance/frontChannel/BrowserControl.java index 3c4a57159d..71dfbe7ae4 100644 --- a/src/main/java/net/openid/conformance/frontChannel/BrowserControl.java +++ b/src/main/java/net/openid/conformance/frontChannel/BrowserControl.java @@ -579,6 +579,16 @@ public WebResponse getResponse(WebRequest webRequest) throws IOException { WebResponse response = super.getResponse(webRequest); +// if (MimeType.APPLICATION_JAVASCRIPT.equals(response.getContentType())) { +// String content = response.getContentAsString(); +// content = content.replace("'use strict';", ""); +// content = content.replace("\"use strict\";", ""); +// +// final WebResponseData data = new WebResponseData(content.getBytes(), +// response.getStatusCode(), response.getStatusMessage(), response.getResponseHeaders()); +// response = new WebResponse(data, response.getWebRequest(), response.getLoadTime()); +// } +// if (response.getStatusCode() == 302) { eventLog.log("WebRunner", args( "msg", "Redirect "+response.getStatusCode() + " " + response.getStatusMessage()+" to " + response.getResponseHeaderValue("location") + " from " + webRequest.getHttpMethod() + " " + webRequest.getUrl(), @@ -703,6 +713,7 @@ protected WebClient modifyWebClient(WebClient client) { client.setWebConnection(new LoggingHttpWebConnection(client)); } + //client.getOptions().setThrowExceptionOnScriptError(false); return client; } }