matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: HTTP response status not checked in CLI install

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug

In cli/install.go:35-36, plugin download doesn't check HTTP status:

resp, err := client.Get(url)
if err != nil { return err }
data, err = io.ReadAll(resp.Body)

To reproduce

  1. Run matcha install https://example.com/nonexistent-plugin
  2. 404 page downloaded and treated as plugin file

Expected behavior

Check resp.StatusCode is 2xx. Show helpful error like 'plugin not found (HTTP 404)'.

andrinoff avatar Apr 24 '26 21:04 andrinoff

Hi 👋 Can't reproduce the bug. Just built on master (db89465) and the result was:

$ ./bin/matcha install https://example.com/nonexistent-plugin
install failed: download returned status 404

volard avatar Apr 27 '26 06:04 volard

Hi 👋 Can't reproduce the bug. Just built on master (db89465) and the result was:

$ ./bin/matcha install https://example.com/nonexistent-plugin
install failed: download returned status 404

may have been fixed, closing the issue.

@volard feel free to pick up any other issue

andrinoff avatar Apr 27 '26 06:04 andrinoff