Dulwich.io dulwich / 5274f14
Update the setting of resp.redirect_location, using code from master in the "try" and 0.19.10 (the last version to not use geturl) in the "catch" H√•vard Tveite authored 29 days ago Jelmer Vernooń≥ committed 26 days ago
1 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
16021602 read = BytesIO(resp.data).read
16031603
16041604 resp.content_type = resp.getheader("Content-Type")
1605 resp_url = resp.geturl()
1606 resp.redirect_location = resp_url if resp_url != url else ''
1607
1605 # Check if geturl() is available (urllib3 version >= 1.23)
1606 try:
1607 resp_url = resp.geturl()
1608 except AttributeError:
1609 # get_redirect_location() is available for urllib3 >= 1.1
1610 resp.redirect_location = resp.get_redirect_location()
1611 else:
1612 resp.redirect_location = resp_url if resp_url != url else ''
16081613 return resp, read
16091614
16101615 def _discover_references(self, service, base_url):