Skip to content

Commit

Permalink
Avoid cycle in getScheme().
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaMaciaszek committed Mar 31, 2021
1 parent 9804818 commit 993f4ee
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import com.netflix.appinfo.InstanceInfo;

import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.core.style.ToStringCreator;
import org.springframework.util.Assert;
Expand Down Expand Up @@ -81,7 +80,9 @@ public boolean isSecure() {

@Override
public URI getUri() {
return DefaultServiceInstance.getUri(this);
String scheme = (isSecure()) ? "https" : "http";
String uri = String.format("%s://%s:%s", scheme, getHost(), getPort());
return URI.create(uri);
}

@Override
Expand Down

0 comments on commit 993f4ee

Please sign in to comment.