Skip to content

Commit

Permalink
Merge pull request #165 from vipyrsec/remove-trailing-slash
Browse files Browse the repository at this point in the history
Remove trailing slash in get commit hash endpoint
  • Loading branch information
Robin5605 committed Aug 13, 2023
2 parents 05bc976 + 8285aa7 commit f1b14dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mainframe/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def build_auth_header(access_token: str) -> dict[str, str]:

def fetch_commit_hash(http_session: Session, *, repository: str, access_token: str) -> str:
"""Fetch the top commit hash of the given repository"""
url = f"https://api.github.com/repos/{repository}/commits/main/"
url = f"https://api.github.com/repos/{repository}/commits/main"
authentication_headers = build_auth_header(access_token)
json_headers = {"Accept": "application/vnd.github.VERSION.sha"}
headers = authentication_headers | json_headers
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_build_auth_header():

def test_fetch_commit_hash():
mock_session: Any = Mock()
url = "https://api.github.com/repos/owner-name/repo-name/commits/main/"
url = "https://api.github.com/repos/owner-name/repo-name/commits/main"
headers = {
"Authorization": "Bearer token",
"Accept": "application/vnd.github.VERSION.sha",
Expand Down

0 comments on commit f1b14dc

Please sign in to comment.