Skip to content

recut: update livecheck#255072

Open
samford wants to merge 1 commit intomainfrom
recut-update-livecheck
Open

recut: update livecheck#255072
samford wants to merge 1 commit intomainfrom
recut-update-livecheck

Conversation

@samford
Copy link
Copy Markdown
Member

@samford samford commented Mar 20, 2026

Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.

In the following questions <cask> is the token of the cask you're submitting.

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • 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.

If AI was used to generate or assist with generating the PR:

  • I used AI to generate or assist with generating this PR. Please specify below how you used AI to help you.
  • I have personally reviewed, tested and verified all changes/additions, including zap stanza paths.

livecheck is erroneously returning "9" as the latest version for recut, as the redirection URLs include a lot of added query string parameters now. This addresses the issue by adding a basic regex to match the version from the file name. We can tighten this regex as needed in the future but I've started pretty loose.

livecheck is erroneously returning "9" as the latest version for
`recut`, as the redirection URLs include a lot of added query string
parameters now. This addresses the issue by adding a basic regex to
match the version from the file name. We can tighten this regex as
needed in the future but I've started pretty loose.
@samford samford added the livecheck Issues or PRs related to livecheck label Mar 20, 2026
@chenrui333
Copy link
Copy Markdown
Member

Error: Download failed on Cask 'recut' with message: Download failed: https://updates.getrecut.com/universal/Recut_4.3.4_universal.dmg
Error: Process completed with exit code 1.

@samford
Copy link
Copy Markdown
Member Author

samford commented Mar 30, 2026

Coming back to this, upstream is now using Rails ActiveStorage blob redirects to point to a Cloudflare storage URL with a bunch of transient query string parameters. The https://updates.getrecut.com/latest-mac URL redirects to the Rails ActiveStorage blob redirection and I assume that URL should remain the same for a given version, so we may be able to use that if we also capture the redirection identifier from the Location header in the first response.

I've tested this approach and it seems to work as expected but the issue is that livecheck's HeaderMatch strategy merges response headers and only keeps the last instance of a given header. The upstream URL redirects more than once, so we can't match the first Location value without being able to access the original headers array.

The Sparkle strategy varies the value that's passed into a strategy block based on the name of the first block parameter (item vs. items), so we can support this by doing the same thing for HeaderMatch (e.g., headers vs. all_headers). This is something that I intended to support if we ever needed it, so I'll create a brew PR to implement it and update this PR if/when it's available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

livecheck Issues or PRs related to livecheck

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants