From 8888fdf9b0173db6fdaa3f988a34f87fcb0b9a12 Mon Sep 17 00:00:00 2001 From: Gabor Pihaj Date: Thu, 18 Dec 2025 13:42:06 +0000 Subject: [PATCH] caldav: don't generate comp tag if it's empty Closes: https://github.com/emersion/go-webdav/issues/196 --- caldav/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/caldav/client.go b/caldav/client.go index 39d828e..c7ecb6f 100644 --- a/caldav/client.go +++ b/caldav/client.go @@ -128,6 +128,10 @@ func (c *Client) FindCalendars(ctx context.Context, calendarHomeSet string) ([]C } func encodeCalendarCompReq(c *CalendarCompRequest) (*comp, error) { + if c == nil || (c.Name == "" && !c.AllProps && !c.AllComps && len(c.Props) == 0 && len(c.Comps) == 0) { + return nil, nil + } + encoded := comp{Name: c.Name} if c.AllProps {