mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
fully resolve well-known URI (#481)
Currently, `find_dav` only resolves a single redirect. When using Baïkal behind a proxy with HTTPS, this becomes an issue: 1. dav.example.com/.well-known/caldav (Apache rewrite to http) 2. dav.example.com/dav.php (http) 3. dav.example.com/dav.php (https) The Apache configuration is provided by Baïkal, hence it is also possible to fix it server-side: -RewriteRule /.well-known/carddav /dav.php [R,L] +RewriteRule /.well-known/carddav https://dav.example.com/dav.php [R,L] -RewriteRule /.well-known/caldav /dav.php [R,L] +RewriteRule /.well-known/caldav https://dav.example.com/dav.php [R,L]
This commit is contained in:
parent
97bfccdb44
commit
48d72aa7a1
1 changed files with 2 additions and 2 deletions
|
|
@ -127,10 +127,10 @@ class Discover(object):
|
|||
def find_dav(self):
|
||||
try:
|
||||
response = self.session.request(
|
||||
'GET', self._well_known_uri, allow_redirects=False,
|
||||
'GET', self._well_known_uri, allow_redirects=True,
|
||||
headers=self.session.get_default_headers()
|
||||
)
|
||||
return response.headers.get('Location', '')
|
||||
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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue