Commit 29f04fa
fix(update): bypass GitHub raw CDN cache for self-update (#22)
## Summary
- `crab update` was always reporting "Already up to date" after a new
version was merged because `raw.githubusercontent.com` serves cached
content (`max-age=300`)
- Added cache-busting via `Cache-Control: no-cache` header and a
timestamp query parameter to force fresh downloads
- Added validation that the downloaded file actually contains a version
string before replacing the installed binary
## Test plan
- [ ] Run `crab update` immediately after merging a version bump —
should detect the new version instead of reporting "Already up to date"
- [ ] Run `crab update` when already on latest — should correctly report
"Already up to date"
- [ ] Simulate a corrupted download (e.g. empty file) — should error
with "Downloaded file is invalid" instead of replacing the binary
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 09f4bf8 commit 29f04fa
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9713 | 9713 | | |
9714 | 9714 | | |
9715 | 9715 | | |
9716 | | - | |
9717 | | - | |
| 9716 | + | |
| 9717 | + | |
| 9718 | + | |
9718 | 9719 | | |
9719 | 9720 | | |
| 9721 | + | |
| 9722 | + | |
| 9723 | + | |
| 9724 | + | |
| 9725 | + | |
| 9726 | + | |
9720 | 9727 | | |
9721 | 9728 | | |
9722 | 9729 | | |
| |||
0 commit comments