-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
get-api 1.0.9 #175582
get-api 1.0.9 #175582
Conversation
I was not sure how to handle the versioning in this case - the URL is unversioned but it's possible to do |
There is a Sparkle feed, but it appears to return a 403 unless some custom headers are provided (at least for me.) It's fronted by Cloudflare. It also contains a versioned URL for use. Tagging @samford for his inputs |
It seems that https://getapi.io/osx/version.xml url is for internal use only, I wasn't able to access it (the same 403 error). I've also added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unversioned cask
URL (https://getapi.io/release/osx/getapi_latest) redirects to a versioned URL (https://files.getapi.io/macos/1.0.8/Get%20API.dmg) but only if you use a GET
request.
Utils::Curl#curl_headers
(which livecheck uses) contains some logic to retry a failing request using GET
(instead of HEAD
) but it doesn't work with the resulting response because the exit status is 8 ("weird server reply"). If we treat that as a usable response (like we do with 22), then we can use strategy :header_match
here instead.
I was looking into this issue recently as I've seen ~22 other casks where HeaderMatch
isn't working for the same reason. I created a tentative fix but I needed to finish going through the others before creating a PR. I just finished a minute ago, so here's the brew PR: Homebrew/brew#17412
If/when that's merged, we can update this PR to use strategy :header_match
instead. Unless there's a reason not to, we may want to try using the versioned dmg URL as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to use the versioned dmg URL (from the getapi_latest
redirection) and to update this to 1.0.9.
The brew PR to allow Utils::Curl#curl_headers
to handle an 8
exist status ("weird server reply") has been merged, so I've updated the livecheck
block to use the getapi_latest
URL with the HeaderMatch
strategy.
The existing `getapi_latest` URL redirects to a versioned dmg when retrieved using a `GET` request, so this updates the cask `url` to use the versioned URL instead. A recent brew change in `Utils::Curl` allows us to use `HeaderMatch` with the `getapi_latest` URL to successfully retrieve the latest version without checking a different source (e.g., GitHub).
After making any changes to a cask, existing or new, verify:
brew audit --cask --online <cask>
is error-free.brew style --fix <cask>
reports no offenses.Additionally, if adding a new cask:
brew audit --cask --new <cask>
worked successfully.HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask>
worked successfully.brew uninstall --cask <cask>
worked successfully.