[SF#992]Add a workaround to fix secure WebDAV access.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 19 Feb 2016 20:43:01 +0000 (22:43 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 19 Feb 2016 20:43:01 +0000 (22:43 +0200)
Just parsing server URI when it's https://webdav.drive.host should
be enough to detect user wants davs:// access.

NEWS
src/connect-server.c

diff --git a/NEWS b/NEWS
index 5601390..8d61c2c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -32,7 +32,8 @@
 * Fixed possible memory corruption in the Connect to Server... dialog.
 
 * Support explicit mention of scheme in the Server line of the Connect to
-    Server... dialog, not duplicate it if it's present.
+    Server... dialog, not duplicate it if it's present. That includes the
+    https:// to fix support for secure WebDAV access as well.
 
 
 Changes on 1.2.3 since 1.2.2:
index 9e1cd6d..31b597c 100644 (file)
@@ -71,12 +71,13 @@ static void on_response(GtkDialog *dialog, gint resp, ConnectDlg *dlg)
         if (tmp != NULL)
         {
             /* support secure webdav here, see SF #992 */
-            if (def_port == 80 && g_str_has_prefix(text, "https"))
-            {
-                if (gtk_spin_button_get_value(dlg->server_port) != 80.0)
-                    def_port = 443;
-                g_string_assign(str, "https");
-            }
+            if (def_port == 80)
+                if (g_str_has_prefix(text, "https:") || g_str_has_prefix(text, "davs:"))
+                {
+                    if (gtk_spin_button_get_value(dlg->server_port) != 80.0)
+                        def_port = 443;
+                    g_string_assign(str, "davs");
+                }
             text = tmp + 3; /* after :// */
         }
         g_string_append(str, "://");