[vlc-commits] [Git][videolan/vlc][master] 2 commits: webdav: fix browsing collections with Nextcloud's server

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Jul 23 11:37:30 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
b815b341 by Felix Paul Kühne at 2026-07-23T13:09:52+02:00
webdav: fix browsing collections with Nextcloud's server

- - - - -
fe0c9f11 by Felix Paul Kühne at 2026-07-23T13:09:52+02:00
webdav: fix playback of files via https

Previously, this worked for http only as we did not put the correct
protocol

- - - - -


1 changed file:

- modules/access/webdav.c


Changes:

=====================================
modules/access/webdav.c
=====================================
@@ -100,7 +100,8 @@ static char *BuildChildUrl(access_sys_t *sys, const char *href)
     return abs;
 }
 
-static bool IsSelfHref(const access_sys_t *sys, const char *href)
+static bool IsSelfHref(const access_sys_t *sys, const char *href,
+                       bool is_collection)
 {
     vlc_url_t u;
     if (vlc_UrlParse(&u, href) != 0 || u.psz_path == NULL)
@@ -112,7 +113,12 @@ static bool IsSelfHref(const access_sys_t *sys, const char *href)
     /* Compare the href path against our request path (without any query). */
     size_t hlen = strlen(u.psz_path);
     size_t slen = strcspn(sys->path, "?");
+
+    if (is_collection && hlen == slen + 1 && u.psz_path[slen] == '/')
+        u.psz_path[--hlen] = '\0';
+
     bool match = hlen == slen && memcmp(u.psz_path, sys->path, hlen) == 0;
+
     vlc_UrlClean(&u);
     return match;
 }
@@ -442,7 +448,8 @@ static int ParseMultistatus(stream_t *access, stream_t *body,
             {
                 /* memset on successful push transfers href/name ownership
                  * to the vector; ResetEntry frees them otherwise. */
-                if (cur.href != NULL && IsSelfHref(sys, cur.href))
+                if (cur.href != NULL
+                 && IsSelfHref(sys, cur.href, cur.is_collection))
                 {
                     if (self_is_collection_out != NULL)
                         *self_is_collection_out = cur.is_collection;
@@ -522,6 +529,8 @@ static int Open(vlc_object_t *obj)
     if (sys->manager == NULL)
         goto clean;
 
+    sys->url.psz_protocol = sys->secure ? (char *)"https" : (char *)"http";
+
     vlc_credential crd;
     vlc_credential_init(&crd, &sys->url);
 
@@ -575,6 +584,8 @@ static int Open(vlc_object_t *obj)
         goto clean;
     }
 
+    vlc_credential_store(&crd, obj);
+
     /* Follow Location on redirects. */
     if (status == 301 || status == 302 || status == 303
      || status == 307 || status == 308)
@@ -614,7 +625,6 @@ static int Open(vlc_object_t *obj)
         goto clean;
     }
 
-    vlc_credential_store(&crd, obj);
     vlc_credential_clean(&crd);
 
     bool self_is_collection = false;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f85e26685b4f9870a8d059519b6b665300e853f7...fe0c9f11d43e9114bb4fc71173e4cb6fd5251757

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f85e26685b4f9870a8d059519b6b665300e853f7...fe0c9f11d43e9114bb4fc71173e4cb6fd5251757
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list