Skip to content

fix: Follow GitHub redirects when finding the latest version #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jbirch
Copy link

@jbirch jbirch commented Jul 9, 2024

fix: Follow GitHub redirects when finding the latest version.

GitHub has started to return 301 responses when we ask for the latest version. However, this location is the one location we fail to follow redirects. We should follow their guidance (https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api#follow-redirects%22)

jbirch@pitest:~ $ repo="uptime-lab/computeblade-agent"
jbirch@pitest:~ $ curl -w "Return Code: %{http_code}\n" "https://api.github.com/repos/$repo/releases/latest"
{
  "message": "Moved Permanently",
  "url": "https://api.github.com/repositories/661558995/releases/latest",
  "documentation_url": "https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects"
}
Return Code: 301

Fixes #35.

Follow GitHub's recommendation to follow redirects when using their API (https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#follow-redirects%22).

GitHub has started to return 301 responses when we ask for the latest version. However, this location is the one location we fail to follow redirects.

Fixes compute-blade-community#35.
@jbirch jbirch changed the title Follow GitHub redirects when finding the latest version Fix: Follow GitHub redirects when finding the latest version Jul 9, 2024
@jbirch jbirch changed the title Fix: Follow GitHub redirects when finding the latest version fix: Follow GitHub redirects when finding the latest version Jul 9, 2024
@xvzf xvzf closed this in #37 Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install script doesn't work due to GitHub API changes.
1 participant