From 29405f59efe19c823da1e344e79c51a7c407156d Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 18 May 2014 19:43:09 +0200 Subject: [PATCH] Fix a bug where only basic auth would work --- vdirsyncer/storage/http.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))