Skip to content

Ensure socks5 proxy option parsing is to specification #1688

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rozza
Copy link
Member

@rozza rozza commented Apr 28, 2025

Duplicates are not permitted, where as elsewhere in the connection string they are.

JAVA-5834

Duplicates are not permitted, where as elsewhere in the connection
string they are.

JAVA-5834
@rozza rozza requested review from a team and stIncMale and removed request for a team April 28, 2025 08:53
@@ -1259,6 +1259,19 @@ private void validateProxyParameters() {
throw new IllegalArgumentException(
"Both proxyUsername and proxyPassword must be set together. They cannot be set individually");
}

if (proxyHost != null && optionsMap.get("proxyhost").size() > 1) {
Copy link
Member

@stIncMale stIncMale May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxyHost != null is used here (and similarly below) as a way to check that optionsMap.get("proxyhost") is not null. Let's not do that, because it is not only non-obvious, but also fragile. We may introduce a static method for checking that a null-able Collection has more than one element, which tolerates nulls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants