Skip to content

Commit

Permalink
[java] Revert workaround for old netty http client (addendum to #12843)…
Browse files Browse the repository at this point in the history
… (#14134)

* [java] Revert workaround for old netty http client (addendum to #12843)

Workaround was made as part of the fix (3f7f57c) 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 <[email protected]>
Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
3 people authored Jul 11, 2024
1 parent 7334bfc commit 12769d6
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions java/src/org/openqa/selenium/chromium/ChromiumOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -120,24 +119,12 @@ public T addArguments(String... arguments) {
* "allow-outdated-plugins");
* </code></pre>
*
* <p>Each argument may contain an option "--" prefix: "--foo" or "foo". Arguments with an
* <p>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<String> 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<String> newArg =
arguments.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst();
Optional<String> existingArg =
args.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst();
if (newArg.isPresent() && existingArg.isPresent()) {
args.remove(existingArg.get());
}
args.addAll(arguments);
return (T) this;
}
Expand Down

0 comments on commit 12769d6

Please sign in to comment.