refactor: updated cmd request and added plugin info

This commit is contained in:
David Allen 2025-08-30 00:04:17 -06:00
parent 4d96010199
commit 0f6f8957f6
Signed by: towk
GPG key ID: 0430CDBE22619155
3 changed files with 72 additions and 4 deletions

View file

@ -69,7 +69,20 @@ func (s *Service) GetPluginInfo() http.HandlerFunc {
func (s *Service) GetPluginRaw() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var (
pluginName = chi.URLParam(r, "name")
path = s.PathForPluginWithName(pluginName)
rawPlugin []byte
err error
)
rawPlugin, err = os.ReadFile(path)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Write(rawPlugin)
}
}