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

Prevent "null" url server url prefix #1003

Merged
merged 2 commits into from
Apr 25, 2018
Merged

Prevent "null" url server url prefix #1003

merged 2 commits into from
Apr 25, 2018

Conversation

encyphered
Copy link
Contributor

When set shouldUseDns as true with null eurekaServer.context, EndpointUtils#getServiceUrlsFromDNS appends "null" string to service url postfix.

e.g. http://ec2-10-0-0-1.ap-northeast-2.compute.amazonaws.com/null/

Fixed this.

}
sb.append(clientConfig.getEurekaServerURLContext());
}
String serviceUrl = sb.toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi. To replicate the existing behaviour, when the context is not null, this should append an additional /.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Added commit to append slash.

if (!clientConfig.getEurekaServerURLContext().startsWith("/")) {
sb.append("/");
}
sb.append(clientConfig.getEurekaServerURLContext());
Copy link
Contributor

Choose a reason for hiding this comment

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

there should still be a final check here that

if (!clientConfig.getEurekaServerURLContext().endsWith("/") {
   sb.append("/");
}

@qiangdavidliu
Copy link
Contributor

Merging this and addressing the PR comment in a separate PR.

@qiangdavidliu qiangdavidliu merged commit 935f627 into Netflix:master Apr 25, 2018
qiangdavidliu added a commit to qiangdavidliu/eureka that referenced this pull request Apr 25, 2018
qiangdavidliu added a commit that referenced this pull request Apr 25, 2018
address dangling PR comments for PRs #976 and #1003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants