restored scheme choosing logic in webfinger service.

pull/419/head
William Kim 12 years ago
parent ae2529a327
commit 22b89f50be

@ -249,8 +249,17 @@ public class WebfingerIssuerService implements IssuerService {
RestTemplate restTemplate = new RestTemplate(httpFactory);
// construct the URL to go to
// preserving http scheme is strictly for demo system use only.
String scheme = key.getScheme();
if (!Strings.isNullOrEmpty(scheme) && scheme.equals("http")) {
scheme = "http://"; // add on colon and slashes.
logger.warn("Webfinger endpoint MUST use the https URI scheme.");
} else {
scheme = "https://";
}
// do a webfinger lookup
URIBuilder builder = new URIBuilder("https://"
URIBuilder builder = new URIBuilder(scheme
+ key.getHost()
+ (key.getPort() >= 0 ? ":" + key.getPort() : "")
+ Strings.nullToEmpty(key.getPath())

Loading…
Cancel
Save