Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Oct 12, 2024
1 parent c28524f commit f8c0d2c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected Tuple4<Playwright, Browser, BrowserContext, Page> createPlaywrightWork
try {
playwright = Playwright.create(new Playwright.CreateOptions().setEnv(options));
browser = getBrowserType(playwright).launch(launchOptions);
browserContext = this.createAuthenticatedContext(browser, newContextOptions);
browserContext = createAuthenticatedContext(browser, newContextOptions);
page = browserContext.newPage();
} catch (final Exception e) {
if (logger.isDebugEnabled()) {
Expand Down Expand Up @@ -469,7 +469,7 @@ protected String getCharSet(final Response response) {
if (StringUtil.isNotBlank(contentType)) {
final String[] result = StreamUtil.split(contentType, ";").get(stream -> stream.map(s -> {
final String[] values = s.split("=");
if ((values.length == 2) && "charset".equalsIgnoreCase(values[0].trim())) {
if (values.length == 2 && "charset".equalsIgnoreCase(values[0].trim())) {
return values[1].trim();
}
return null;
Expand Down Expand Up @@ -504,7 +504,7 @@ protected NewContextOptions initNewContextOptions() {
final String proxyBypass = getInitParameter(PROXY_BYPASS_PROPERTY, null, String.class);

if (!StringUtils.isBlank(proxyHost)) {
final String proxyAddress = proxyPort == null ? proxyHost : (proxyHost + ":" + proxyPort);
final String proxyAddress = proxyPort == null ? proxyHost : proxyHost + ":" + proxyPort;
final Proxy proxy = new Proxy(proxyAddress);
if (proxyCredentials != null) {
proxy.setUsername(proxyCredentials.getUserName());
Expand Down Expand Up @@ -540,7 +540,7 @@ protected BrowserContext createAuthenticatedContext(final Browser browser, final

final BrowserContext playwrightContext = browser.newContext(newContextOptions);
try (final var fessHttpClient = new HcHttpClient()) {
fessHttpClient.setInitParameterMap(this.initParamMap);
fessHttpClient.setInitParameterMap(initParamMap);
fessHttpClient.init();
final List<org.apache.http.cookie.Cookie> fessCookies = fessHttpClient.cookieStore.getCookies();
final List<Cookie> playwrightCookies = fessCookies.stream().map(apacheCookie -> {
Expand Down Expand Up @@ -577,7 +577,7 @@ public void setDownloadTimeout(final int downloadTimeout) {
}

public void setRenderedState(final LoadState loadState) {
this.renderedState = loadState;
renderedState = loadState;
}

public void setCloseTimeout(final int closeTimeout) {
Expand Down

0 comments on commit f8c0d2c

Please sign in to comment.