From 12769d6785755c05418f019a73d0d3d3daf01c57 Mon Sep 17 00:00:00 2001 From: Oleksandr Kulychok Date: Thu, 11 Jul 2024 12:53:40 +0300 Subject: [PATCH] [java] Revert workaround for old netty http client (addendum to #12843) (#14134) * [java] Revert workaround for old netty http client (addendum to #12843) Workaround was made as part of the fix (3f7f57cf) the bug #11750 which was specific for netty client only. Since #12843 the netty client was removed. * Running format script --------- Co-authored-by: Diego Molina Co-authored-by: Diego Molina --- .../openqa/selenium/chromium/ChromiumOptions.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/java/src/org/openqa/selenium/chromium/ChromiumOptions.java b/java/src/org/openqa/selenium/chromium/ChromiumOptions.java index 2af0a72c93bf8..6f93930787217 100644 --- a/java/src/org/openqa/selenium/chromium/ChromiumOptions.java +++ b/java/src/org/openqa/selenium/chromium/ChromiumOptions.java @@ -31,7 +31,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.TreeMap; import java.util.stream.Stream; @@ -120,24 +119,12 @@ public T addArguments(String... arguments) { * "allow-outdated-plugins"); * * - *

Each argument may contain an option "--" prefix: "--foo" or "foo". Arguments with an + *

Each argument may contain an optional "--" prefix: "--foo" or "foo". Arguments with an * associated value should be delimited with an "=": "foo=bar". * * @param arguments The arguments to use when starting Chrome. */ public T addArguments(List arguments) { - /* - --remote-allow-origins is being added by default since Chrome 111. We need to check - if the argument already exists and then remove it. - */ - String remoteAllowOrigins = "remote-allow-origins"; - Optional newArg = - arguments.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst(); - Optional existingArg = - args.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst(); - if (newArg.isPresent() && existingArg.isPresent()) { - args.remove(existingArg.get()); - } args.addAll(arguments); return (T) this; }