Parcourir la source

use davs instead of dav when https is used

Guénaël Muller il y a 6 ans
Parent
révision
f1c2809ef6

+ 7 - 0
tracim/tracim/controllers/workspace.py Voir le fichier

@@ -101,14 +101,21 @@ class UserWorkspaceRestController(TIMRestController):
101 101
         )
102 102
 
103 103
         dictified_workspace = Context(CTX.WORKSPACE).toDict(workspace, 'workspace')
104
+
105
+        # INFO - G.M - 15-02-2018 - Deal with url scheme for dav link
106
+        # TODO - G.M - 15-02-2018 - Find better solution to deal with url ?
104 107
         webdav_url = CFG.get_instance().WSGIDAV_CLIENT_BASE_URL
105 108
         website_protocol = urlparse(CFG.get_instance().WEBSITE_BASE_URL).scheme
109
+        dav_protocol = 'dav'
110
+        if website_protocol == "https":
111
+            dav_protocol = 'davs'
106 112
 
107 113
         return DictLikeClass(
108 114
             result=dictified_workspace,
109 115
             fake_api=fake_api,
110 116
             webdav_url=webdav_url,
111 117
             website_protocol = website_protocol,
118
+            dav_protocol = dav_protocol,
112 119
             show_deleted=show_deleted,
113 120
             show_archived=show_archived,
114 121
         )

+ 1 - 1
tracim/tracim/templates/workspace/getone.mak Voir le fichier

@@ -134,7 +134,7 @@
134 134
                 <p></p>
135 135
                 <div class="input-group">
136 136
                     <span class="input-group-addon" style="width: 8em;"><i class="fa fa-fw fa-linux"></i> Linux</span>
137
-                    <div class="form-control webdavconfig__input">dav://${webdav_url}</div>
137
+                    <div class="form-control webdavconfig__input">${dav_protocol}://${webdav_url}</div>
138 138
                 </div>
139 139
             </div>
140 140
             <div class="col-md-6">