Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

REST API Get Plugin does not return plugin info #504

Closed
lynxbat opened this issue Nov 14, 2015 · 0 comments
Closed

REST API Get Plugin does not return plugin info #504

lynxbat opened this issue Nov 14, 2015 · 0 comments
Labels

Comments

@lynxbat
Copy link
Contributor

lynxbat commented Nov 14, 2015

It appears to only do anything if you are requesting a download of the plugin:

    rd := r.FormValue("download")
    d, _ := strconv.ParseBool(rd)
    if d {
        b, err := ioutil.ReadFile(plugin.PluginPath())
        if err != nil {
            f["plugin-path"] = plugin.PluginPath()
            pe := perror.New(err, f)
            respond(500, rbody.FromPulseError(pe), w)
            return
        }

        w.Header().Set("Content-Encoding", "gzip")
        gz := gzip.NewWriter(w)
        defer gz.Close()
        _, err = gz.Write(b)
        if err != nil {
            f["plugin-path"] = plugin.PluginPath()
            pe := perror.New(err, f)
            respond(500, rbody.FromPulseError(pe), w)
            return
        }
        return
    }

It should return the rbody for a LoadedPlugin

lynxbat added a commit that referenced this issue Nov 16, 2015
Fixes #504 - adds plugin GET response for single plugin API calls
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant