Caldav Discovery From iOS to caldav Server

Viewed 174

According to a few online articles, iOS will make a PROPFIND request and then an OPTIONS request for the first two parts of discovery.

I've created a caldav server with aspnetcore api on iis. I have implemented middleware to capture ALL incoming requests and responses.

My api will successfully re-route from .well-known/caldav request, request Authentication, and then respond to the first PROPFIND. After responding, iOS then keeps trying to make the same PROPFIND request to different URLs. Something must be wrong with my response, but I just don't see it.

I've dug through the dav/caldav specs/RFCs. etc

I found these two articles: Caldav Discovery Caldav Handshake

Similar question, but I do not get OPTIONS request

What is wrong with my response?

iOS PROPFIND request

<?xml version="1.0" encoding="UTF-8"?>
<A:propfind xmlns:A="DAV:">
  <A:prop>
    <A:current-user-principal/>
    <A:principal-URL/>
    <A:resourcetype/>
  </A:prop>
</A:propfind>

Server Response and headers:

Cache-Control no-cache,no-store Pragma no-cache Content-Type application/xml

<?xml version="1.0" encoding="UTF-8"?>
<multistatus xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:CS="http://calendarserver.org/ns/">
  <D:response>
    <D:href>/calendars/</D:href>
    <D:propstat>
      <D:status>HTTP/1.1 200 OK</D:status>
      <D:prop>
        <D:current-user-principal>
          <D:href>/calendars/user@user.com/</D:href>
        </D:current-user-principal>
        <D:resourcetype>
          <D:collection />
        </D:resourcetype>
      </D:prop>
    </D:propstat>
  </D:response>

IIS Request Logs:

1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 109, 479, 314, 308, 0, PROPFIND, /.well-known/caldav, -,
1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 125, 471, 453, 401, 0, PROPFIND, /calendars/, -,
1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 93, 538, 1829, 207, 0, PROPFIND, /calendars/, -,
1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 78, 1256, 282, 404, 0, PROPFIND, /, -,
1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 78, 1267, 453, 401, 0, PROPFIND, /principals/, -,
1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 78, 1334, 1829, 207, 0, PROPFIND, /principals/, -,
1.1.1.1, -, 5/16/2021, 23:49:12, W3SVC8, myserver, 2.2.2.2, 62, 1292, 282, 404, 0, PROPFIND, /calendar/dav/user@user.com/user/, -,

After the third request, I've reported back a response, but looks like iOS is still trying some other URLs with the same PROPFIND request.

0 Answers
Related