Obey useragent setting for DAV discovery

This commit is contained in:
Markus Unterwaditzer 2015-05-15 00:15:02 +02:00
parent eec503b7d7
commit 55be28c12b
2 changed files with 6 additions and 2 deletions

View file

@ -21,6 +21,8 @@ Version 0.5.0
- Use only one worker if debug mode is activated. - Use only one worker if debug mode is activated.
- ``verify=false`` is now disallowed in vdirsyncer, please use - ``verify=false`` is now disallowed in vdirsyncer, please use
``verify_fingerprint`` instead. ``verify_fingerprint`` instead.
- Fixed a bug where vdirsyncer's DAV storage was not using the configured
useragent for collection discovery.
Version 0.4.4 Version 0.4.4
============= =============

View file

@ -94,8 +94,10 @@ class Discover(object):
def find_dav(self): def find_dav(self):
try: try:
response = self.session.request('GET', self._well_known_uri, response = self.session.request(
allow_redirects=False) 'GET', self._well_known_uri, allow_redirects=False,
headers=self.session.get_default_headers()
)
return response.headers.get('Location', '') return response.headers.get('Location', '')
except (HTTPError, exceptions.Error): except (HTTPError, exceptions.Error):
# The user might not have well-known URLs set up and instead points # The user might not have well-known URLs set up and instead points