Skip to content

Commit

Permalink
Use better way to get redirected URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Oct 7, 2023
1 parent c4a2892 commit bcf0976
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,13 @@ def get_issue(self, issue_id: str = "", **kwargs) -> Issue | None:
if not repo:
try:
response = self.session.head(
f"https://bugs.launchpad.net/bugs/{issue_id}", allow_redirects=False
f"https://bugs.launchpad.net/bugs/{issue_id}", allow_redirects=True
)
response.raise_for_status()
except RequestException as exc:
logging.error("MyLaunchpad: %s: %s", issue_id, exc)
return None
url = urlparse(response.headers["Location"])
url = urlparse(response.url)
repo = url.path[: url.path.index("/+bug/")]
kwargs["repo"] = repo
return super().get_issue(issue_id, **kwargs)
Expand Down

0 comments on commit bcf0976

Please sign in to comment.