2016-06-06 16 views
2

Ich entwickle einen Kalender-Client für CalDAV-Server. Meine Bewerbung ist OK mit Google CalDAV arbeiten. Ich versuche, Kalender aus Yahoo Kalender zu bekommen. Was ist falsch an der Anfrage, die zu einem fehlerhaften Anforderungsfehler geführt hat?Yahoo CalDAV: Schlechte Anfrage zum Erhalten von Kalendern

Erste Optionen Anfrage:

OPTIONS https://caldav.calendar.yahoo.com/dav/aliasgarikh/Calendar/testcalendar HTTP/1.1 
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
Host: caldav.calendar.yahoo.com 
Content-Length: 0 
Connection: Keep-Alive 

Erste Optionen Antwort:

HTTP/1.1 200 OK 
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 05-Jun-2016 20:11:56 GMT 
WSHost: tardis018.cal.bf1.yahoo.com 
DAV: 1, 3, access-control, extended-mkcol, calendar-access 
MS-Author-Via: DAV 
Allow: MKCOL, REPORT, MOVE, COPY, HEAD, POST, GET, DELETE, MKCALENDAR, ACL, PROPFIND, OPTIONS, PROPPATCH, PUT 
Content-Length: 0 
Date: Mon, 06 Jun 2016 20:11:55 GMT 
Server: ATS 
Age: 1 
Connection: keep-alive 
Via: http/1.1 calgate116.cal.ne1.yahoo.com (ApacheTrafficServer) 

Erste Kalender Anfrage:

PROPFIND https://caldav.calendar.yahoo.com/dav/aliasgarikh/Calendar/testcalendar HTTP/1.1 
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
Depth: 0 
Host: caldav.calendar.yahoo.com 
Content-Type: text/xml 
Content-Length: 103 

<options xmlns="DAV:"> 
    <calendar-collection-set xmlns="urn:ietf:params:xml:ns:caldav" /> 
</options> 

Erste Kalender Antwort:

HTTP/1.1 400 Bad Request 
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 05-Jun-2016 20:11:57 GMT 
WSHost: tardis041.cal.bf1.yahoo.com 
Cache-Control: must-revalidate,no-cache,no-store 
Content-Type: text/html;charset=utf-8 
Content-Length: 3190 
Vary: Accept-Encoding 
Date: Mon, 06 Jun 2016 20:11:56 GMT 
Server: ATS 
Age: 2 
Connection: keep-alive 
Via: http/1.1 calgate116.cal.ne1.yahoo.com (ApacheTrafficServer) 

<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
    <title>Yahoo! - Error report</title> 
    <style> 
     /* nn4 hide */ /*/*/ 
     body { 
     font: small/ 1.2em arial, helvetica, clean, sans-serif; 
     font: x-small; 
     text-align: center; 
     } 

     table { 
     font-size: inherit; 
     font: x-small; 
     } 

     html>body { 
     font: 83%/ 1.2em arial, helvetica, clean, sans-serif; 
     } 

     input { 
     font-size: 100%; 
     vertical-align: middle; 
     } 

     p,form { 
     margin: 0; 
     padding: 0; 
     } 

     p { 
     padding-bottom: 6px; 
     margin-bottom: 10px; 
     } 

     #doc { 
     width: 48.5em; 
     margin: 0 auto; 
     border: 1px solid #fff; 
     text-align: center; 
     } 

     #ygma { 
     text-align: right; 
     margin-bottom: 53px 
     } 

     #ygma img { 
     float: left; 
     } 

     #ygma div { 
     border-bottom: 1px solid #ccc; 
     padding-bottom: 8px; 
     margin-left: 152px; 
     } 

     #bd { 
     clear: both; 
     text-align: left; 
     width: 75%; 
     margin: 0 auto 20px; 
     } 

     h1 { 
     font-size: 135%; 
     text-align: center; 
     margin: 0 0 15px; 
     } 

     legend { 
     display: none; 
     } 

     fieldset { 
     border: 0 solid #fff; 
     padding: .8em 0 .8em 4.5em; 
     } 

     form { 
     position: relative; 
     background: #eee; 
     margin-bottom: 15px; 
     border: 1px solid #ccc; 
     border-width: 1px 0; 
     } 

     #s1p { 
     width: 15em; 
     margin-right: .1em; 
     } 

     form span { 
     position: absolute; 
     left: 70%; 
     top: .8em; 
     } 

     form a { 
     font: 78%/ 1.2em arial; 
     display: block; 
     padding-left: .8em; 
     white-space: nowrap; 
     background: url(http://l.yimg.com/a/i/s/bullet.gif) 
     no-repeat left center; 
     } 

     form .sep { 
     display: none; 
     } 

     .more { 
     text-align: center; 
     } 

     #ft { 
     padding-top: 10px; 
     border-top: 1px solid #999; 
     } 

     #ft p { 
     text-align: center; 
     font: 78% arial; 
     } 
     /* end nn4 hide */ 
    </style> 
</head> 
<body> 
<div id="doc"> 
    <div id="ygma"> 
     <a href="http://www.yahoo.com"> 
      <img src="http://l.yimg.com/a/i/yahoo.gif" width="147" 
       height="31" border="0" alt="Yahoo!"> 
     </a> 

     <div> 
      <a href="http://www.yahoo.com">Yahoo!</a> 
      - <a href="http://help.yahoo.com">Help</a> 
     </div> 
    </div> 
    <div id="bd"> 
     <h1>HTTP Status 400 - Error:400</h1> 

     <p> 
      <b>type</b> 
      Status report 
     </p> 

     <p> 
      <b>message</b> 
      <u>Error:400</u> 
     </p> 

     <p> 
      <b>description</b> 
      <u>The request sent by the client was syntactically incorrect.</u> 
     </p> 

     <p> 

     </p> 
    </div> 
</div> 
</body> 
</html> 

Antwort

3

Ihre PROPFIND Anfrage ist vollständig ungültig. Die Payload einer PROPFIND Anfrage (sofern dort eine existiert) muss ein DAV:propfind Wurzelelement haben. Eine gültige Anfrage zum Abrufen des Kalender-Home-Sets finden Sie unter RFC 4791, section 8.4.

Der einzige Grund, warum dies mit Google funktioniert, ist, dass ihr Server ziemlich tolerant zu sein scheint und eine Art Standardantwort zurückgibt (ähnlich wie wenn Sie keinen Nachrichtentext senden würden).