emersion / go-webdav

A Go library for WebDAV, CalDAV and CardDAV
MIT License
314 stars 66 forks source link

Make sure to handle a PROPFIND to `/` #126

Closed cheif closed 1 year ago

cheif commented 1 year ago

It seems like the Reminders app in iOS/macOS does this request as the first thing when setting up an account, so it seems reasonable to handle it for us.

This just returns the most basic current-user-principal now, but that should hopefully be enough to continue the process.

emersion commented 1 year ago

It sounds reasonable to serve a default user principal when the library user doesn't handle that case.

emersion commented 1 year ago

Hm, actually, no, this is the root, not the user principal… Nevermind about using webdav.ServePrincipal.

cheif commented 1 year ago

Yeah, I'm not competent enough in *Dav to know what the most reasonable approach is here.

I just assume that it's proper to respond to the <current-user-principal> request no matter what the path is.

emersion commented 1 year ago

Okay. Can we copy-paste propFindUserPrincipal over to a new propFindRoot function which only returns the current user principal prop?

Also I think the CurrentUserPrincipal call can be dropped, its result is unused.

cheif commented 1 year ago

@emersion Done! 😄