diff --git a/contributor_stats.py b/contributor_stats.py index 7ddb36d..1200f65 100644 --- a/contributor_stats.py +++ b/contributor_stats.py @@ -153,10 +153,12 @@ def get_sponsor_information(contributors: list, token: str, ghe: str) -> list: variables = {"username": contributor.username} # Send the GraphQL request - api_endpoint = f"{ghe}/api/v3" if ghe else "https://api.github.com" + api_endpoint = ( + f"{ghe}/api/v3".removeprefix("https://") if ghe else "api.github.com" + ) headers = {"Authorization": f"Bearer {token}"} response = requests.post( - f"{api_endpoint}/graphql", + f"https://{api_endpoint}/graphql", json={"query": query, "variables": variables}, headers=headers, timeout=60, diff --git a/contributors.py b/contributors.py index 102b854..42491c0 100644 --- a/contributors.py +++ b/contributors.py @@ -173,7 +173,7 @@ def get_contributors(repo: object, start_date: str, end_date: str, ghe: str): continue # Store the contributor information in a ContributorStats object - api_endpoint = ghe if ghe else "github.com" + api_endpoint = ghe.removeprefix("https://") if ghe else "github.com" if start_date and end_date: commit_url = f"https://{api_endpoint}/{repo.full_name}/commits?author={user.login}&since={start_date}&until={end_date}" else: