소스 검색

filename is query param

Mohammed Nafees 4 년 전
부모
커밋
638c1a368c
1개의 변경된 파일과 4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      api/server/handlers/gitinstallation/rerun_workflow.go

+ 4 - 4
api/server/handlers/gitinstallation/rerun_workflow.go

@@ -3,6 +3,7 @@ package gitinstallation
 import (
 	"context"
 	"errors"
+	"fmt"
 	"net/http"
 
 	"github.com/google/go-github/v41/github"
@@ -10,7 +11,6 @@ import (
 	"github.com/porter-dev/porter/api/server/shared"
 	"github.com/porter-dev/porter/api/server/shared/apierrors"
 	"github.com/porter-dev/porter/api/server/shared/config"
-	"github.com/porter-dev/porter/api/server/shared/requestutils"
 )
 
 var ErrNoWorkflowRuns = errors.New("no previous workflow runs found")
@@ -36,10 +36,10 @@ func (c *RerunWorkflowHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
 		return
 	}
 
-	filename, reqErr := requestutils.GetURLParamString(r, "filename")
+	filename := r.URL.Query().Get("filename")
 
-	if reqErr != nil {
-		c.HandleAPIError(w, r, apierrors.NewErrInternal(reqErr))
+	if filename == "" {
+		c.HandleAPIError(w, r, apierrors.NewErrInternal(fmt.Errorf("filename query param not set")))
 		return
 	}