Fallback to PROPFIND when REPORT addressbook-query returns 400, 403, 500 or 501

* increase max. log line length to 80 characters
parent 9d19d975
......@@ -33,7 +33,7 @@ import de.duenndns.ssl.MemorizingTrustManager;
import lombok.RequiredArgsConstructor;
public class HttpClient extends OkHttpClient {
private final int MAX_LOG_LINE_LENGTH = 71;
private final int MAX_LOG_LINE_LENGTH = 80;
final static UserAgentInterceptor userAgentInterceptor = new UserAgentInterceptor();
......
......@@ -117,7 +117,13 @@ public class ContactsSyncManager extends SyncManager {
try {
davAddressBook().addressbookQuery();
} catch(HttpException e) {
if (e.status/100 == 4) {
/* non-successful responses to CARDDAV:addressbook-query with empty filter, tested on 2015/10/21
* fastmail.com 403 Forbidden (DAV:error CARDDAV:supported-filter)
* mailbox.org (OpenXchange) 400 Bad Request
* SOGo 207 Multi-status, but without entries http://www.sogo.nu/bugs/view.php?id=3370
* Zimbra ZCS 500 Server Error https://bugzilla.zimbra.com/show_bug.cgi?id=101902
*/
if (e.status == 400 || e.status == 403 || e.status == 500 || e.status == 501) {
log.warn("Server error on REPORT addressbook-query, falling back to PROPFIND", e);
davAddressBook().propfind(1, GetETag.NAME);
} else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment