539
539
parsed_url = self._split_url(target)
540
540
# Recalculate base path. This is needed to ensure that when the
542
542
# redirected, we end up with the same url
543
543
base_path = parsed_url.path[:-len(relpath)]
544
544
if parsed_url.scheme in ('http', 'https'):