diff --git a/vdirsyncer/storage/http.py b/vdirsyncer/storage/http.py index 25160d1..d56866d 100644 --- a/vdirsyncer/storage/http.py +++ b/vdirsyncer/storage/http.py @@ -15,12 +15,14 @@ USERAGENT = 'vdirsyncer' def prepare_auth(auth, username, password): - if (username and password) or auth == 'basic': + if auth == 'basic': return (username, password) elif auth == 'digest': from requests.auth import HTTPDigestAuth return HTTPDigestAuth(username, password) elif auth is None: + if username and password: + return (username, password) return None else: raise ValueError('Unknown authentication method: {}'.format(auth))