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-ID : 59160 , fix extracting host for ipv6 address #213

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

FROZENCADET
Copy link
Contributor

Consider the last occurrence of ':' while getting the indexOfPath as IPv6 address has more than one ':'.

@@ -435,7 +435,8 @@ private String parseUri(final String uri) {
throw new BuildException("no username was given. Can't authenticate.");
}

final int indexOfPath = uri.indexOf(':', indexOfAt + 1);
// For IPv6 address having more than one ":", it should look for the last occurrence
final int indexOfPath = uri.lastIndexof(':');
if (indexOfPath == -1) {
Copy link
Member

Choose a reason for hiding this comment

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

we should still ensure indexOfPath is bigger than indexOfAt. So maybe we change the if to not only throw if it is -1 but rather if it is less than or equal indexOfAt (equal could be the case if indexOfAt is -1 itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree.. have made the required changes

@bodewig
Copy link
Member

bodewig commented Oct 8, 2024

@asfgit asfgit merged commit 7c6c127 into apache:master Oct 14, 2024
@bodewig
Copy link
Member

bodewig commented Oct 14, 2024

@FROZENCADET actually the code didn't even compile see 2540910

Merged, thank you.

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.

3 participants