caldav: don't generate comp tag if it's empty

Closes: https://github.com/emersion/go-webdav/issues/196
This commit is contained in:
Gabor Pihaj 2025-12-18 13:42:06 +00:00 committed by GitHub
parent 82bb8a7aea
commit 8888fdf9b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {