NewAgreementScreen: Fix URL scheme check

If someone uses http or https urls for the agreement, it would not work
as it would have checked http and https but not one or the other.

Change-Id: Ifb63e94a4d81297554f52d0b314cb1273b6c2b79
This commit is contained in:
Paladox none
2017-08-25 19:22:26 +00:00
parent e6458a2d27
commit bf634810a7

View File

@@ -219,7 +219,7 @@ public class NewAgreementScreen extends AccountScreen {
if (url != null && url.length() > 0) {
agreementGroup.setVisible(true);
agreementHtml.setText(Gerrit.C.rpcStatusWorking());
if (!url.startsWith("http:") && !url.startsWith("https:")) {
if (!url.startsWith("http:") || !url.startsWith("https:")) {
url = GWT.getHostPageBaseURL() + url;
}
final RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);