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

Bug fix: Do not ignore scheme property in Java client #12332

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

KKcorps
Copy link
Contributor

@KKcorps KKcorps commented Jan 29, 2024

Scheme property already has a default value of http when initialised. This leads to a bug where we always ignore when a scheme is set using properties.

Comment on lines +88 to 91
String scheme = properties.getProperty("scheme", CommonConstants.HTTP_PROTOCOL);
if (_scheme == null || !_scheme.contentEquals(scheme)) {
_scheme = scheme;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is equivalent to setting directly right?

_scheme = properties.getProperty("scheme", CommonConstants.HTTP_PROTOCOL);

in what scenarios is this not true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When someone is using Java Client in their code and do not use the builder pattern, the scheme:https property never gets enforced

Copy link
Contributor

@walterddr walterddr Feb 5, 2024

Choose a reason for hiding this comment

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

i dont understand. the code is literally setting the class variable _schema to the property value schema.
In any cases the schema variable is different from _schema?

Copy link
Contributor

Choose a reason for hiding this comment

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

@KKcorps KKcorps merged commit b38fcee into apache:master Feb 14, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants