fix: issue with plugins not downloading
This commit is contained in:
parent
135245ca9c
commit
f917d2b6f8
1 changed files with 4 additions and 3 deletions
|
|
@ -5,9 +5,9 @@ import (
|
|||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
makeshift "git.towk2.me/towk/makeshift/pkg"
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
func (s *Service) ListPlugins() http.HandlerFunc {
|
||||
|
|
@ -42,13 +42,14 @@ func (s *Service) ListPlugins() http.HandlerFunc {
|
|||
func (s *Service) GetPlugin() http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var (
|
||||
pluginName = strings.TrimPrefix(r.URL.Path, "/plugin")
|
||||
pluginName = chi.URLParam(r, "name")
|
||||
path = s.PathForPluginWithName(pluginName)
|
||||
plugin makeshift.Plugin
|
||||
body []byte
|
||||
err error
|
||||
)
|
||||
|
||||
plugin, err = LoadPluginFromFile(pluginName)
|
||||
plugin, err = LoadPluginFromFile(path)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue