diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 0269d73edb..69cb58ccdb 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -603,13 +603,13 @@ EOS # Only try to `git fetch` when the upstream tags have changed # (so the API does not return 304: unmodified). GITHUB_API_ETAG="$(sed -n 's/^ETag: "\([a-f0-9]\{32\}\)".*/\1/p' ".git/GITHUB_HEADERS" 2>/dev/null)" - GITHUB_API_ACCEPT="application/vnd.github.v3+json" + GITHUB_API_ACCEPT="application/vnd.github+json" GITHUB_API_ENDPOINT="tags" else # Only try to `git fetch` when the upstream branch is at a different SHA # (so the API does not return 304: unmodified). GITHUB_API_ETAG="$(git rev-parse "refs/remotes/origin/${UPSTREAM_BRANCH_DIR}")" - GITHUB_API_ACCEPT="application/vnd.github.v3.sha" + GITHUB_API_ACCEPT="application/vnd.github.sha" GITHUB_API_ENDPOINT="commits/${UPSTREAM_BRANCH_DIR}" fi diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index a11c177654..171e1e252d 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -1034,7 +1034,7 @@ class GitHubGitDownloadStrategy < GitDownloadStrategy output, _, status = curl_output( "--silent", "--head", "--location", - "-H", "Accept: application/vnd.github.v3.sha", + "-H", "Accept: application/vnd.github.sha", "https://api.github.com/repos/#{@user}/#{@repo}/commits/#{@ref}" ) @@ -1051,7 +1051,7 @@ class GitHubGitDownloadStrategy < GitDownloadStrategy output, _, status = curl_output( "--silent", "--head", "--location", - "-H", "Accept: application/vnd.github.v3.sha", + "-H", "Accept: application/vnd.github.sha", "https://api.github.com/repos/#{@user}/#{@repo}/commits/#{commit}" ) diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index 8db64eda0c..005f5baf7b 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -184,8 +184,7 @@ module GitHub # This is a no-op if the user is opting out of using the GitHub API. return block_given? ? yield({}) : {} if Homebrew::EnvConfig.no_github_api? - args = ["--header", "Accept: application/vnd.github.v3+json", "--write-out", "\n%\{http_code}"] - args += ["--header", "Accept: application/vnd.github.antiope-preview+json"] + args = ["--header", "Accept: application/vnd.github+json", "--write-out", "\n%\{http_code}"] token = credentials args += ["--header", "Authorization: token #{token}"] unless credentials_type == :none