Skip to content

Commit

Permalink
Check for redirect when handling well-known URLs
Browse files Browse the repository at this point in the history
Fix #584
  • Loading branch information
untitaker committed Mar 7, 2017
1 parent 3b713a1 commit b320127
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions vdirsyncer/storage/dav.py
Expand Up @@ -140,12 +140,15 @@ def find_dav(self):
'GET', self._well_known_uri, allow_redirects=True,
headers=self.session.get_default_headers()
)
return response.url
if response.history:
return response.url
except (HTTPError, exceptions.Error):
# The user might not have well-known URLs set up and instead points
# vdirsyncer directly to the DAV server.
dav_logger.debug('Server does not support well-known URIs.')
return ''
pass

# The user might not have well-known URLs set up and instead points
# vdirsyncer directly to the DAV server.
dav_logger.debug('Server does not support well-known URIs.')
return ''

def find_principal(self, url=None):
if url is None:
Expand Down

0 comments on commit b320127

Please sign in to comment.