Skip to content

Commit

Permalink
Merge pull request #271 from gitautoai/wes
Browse files Browse the repository at this point in the history
Enable create_header() to set media type
  • Loading branch information
hiroshinishio authored Aug 19, 2024
2 parents b9d32ec + 4fc9469 commit a7f577b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/github/github_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ def create_comment_on_issue_with_gitauto_button(payload: GitHubLabeledPayload) -
return response.json()


def create_headers(token: str) -> dict[str, str]:
def create_headers(token: str, media_type: Optional[str] = "v3") -> dict[str, str]:
"""https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28#headers"""
return {
"Accept": "application/vnd.github.v3+json",
"Accept": f"application/vnd.github.{media_type}+json",
"Authorization": f"Bearer {token}",
"User-Agent": GITHUB_APP_NAME,
"X-GitHub-Api-Version": GITHUB_API_VERSION,
Expand Down

0 comments on commit a7f577b

Please sign in to comment.