Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions java/src/org/openqa/selenium/chromium/ChromiumOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,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
Loading