refactor: updated cmd request and added plugin info
This commit is contained in:
parent
4d96010199
commit
0f6f8957f6
3 changed files with 72 additions and 4 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue