From 990d8f682c048b40035a72613092adb9f115d56a Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Fri, 23 Oct 2015 00:05:32 +0200 Subject: [PATCH] =?UTF-8?q?#21=20not=20sure=20if=20I=20need=20to=20type=20?= =?UTF-8?q?in=20http/https=20=E2=80=93=20it=20should=20work=20without=20an?= =?UTF-8?q?y=20protocol=20prepended,=20and=20try=20with=20https=20by=20def?= =?UTF-8?q?ault?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../owncloud/notes/android/activity/SettingsActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/SettingsActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/SettingsActivity.java index af4a231c..fc2cebfe 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/SettingsActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/SettingsActivity.java @@ -59,6 +59,9 @@ public class SettingsActivity extends AppCompatActivity { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { String url = ((EditText) findViewById(R.id.settings_url)).getText().toString(); + if (!url.startsWith("http://") && !url.startsWith("https://")) { + url = "https://" + url; + } new URLValidatorAsyncTask().execute(url); if (NotesClientUtil.isHttp(url)) { @@ -88,7 +91,10 @@ public class SettingsActivity extends AppCompatActivity { if (!url.endsWith("/")) { url += "/"; } - + if (!url.startsWith("http://") && !url.startsWith("https://")) { + url = "https://" + url; + } + Log.v("Note", "URL: " + url); new LoginValidatorAsyncTask().execute(url, username, password); } });