Skip to content

Commit d53e6e2

Browse files
fix: caldav url paths could contain empty segments after (#2030)
1 parent dcd0117 commit d53e6e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/Services/CalDAV/CalDAVClient.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public class Services.CalDAV.CalDAVClient : Services.CalDAV.WebDAVClient {
574574
}
575575
576576
public async HttpResponse add_item (Objects.Item item, bool update = false) {
577-
var url = update ? item.ical_url : "%s/%s".printf (item.project.calendar_url, "%s.ics".printf (item.id));
577+
var url = update ? item.ical_url : GLib.Path.build_path("/", item.project.calendar_url, "%s.ics".printf (item.id));
578578
var body = item.to_vtodo ();
579579
580580
var expected = update ? new Soup.Status[]{ Soup.Status.NO_CONTENT }
@@ -614,7 +614,7 @@ public class Services.CalDAV.CalDAVClient : Services.CalDAV.WebDAVClient {
614614
615615
616616
public async HttpResponse move_item (Objects.Item item, Objects.Project destination_project) {
617-
var destination = "%s/%s".printf (destination_project.calendar_url, "%s.ics".printf (item.id));
617+
var destination = GLib.Path.build_path("/", destination_project.calendar_url, "%s.ics".printf (item.id));
618618
619619
var headers = new HashTable<string,string> (str_hash, str_equal);
620620
headers.insert ("Destination", destination);

0 commit comments

Comments
 (0)