mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(api): introduce libhttp usage (#2263)
This commit is contained in:
parent
42f5aec6a5
commit
b24891a6bc
102 changed files with 244 additions and 473 deletions
|
@ -3,10 +3,10 @@ package upload
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
"github.com/portainer/libhttp/request"
|
||||
"github.com/portainer/libhttp/response"
|
||||
"github.com/portainer/portainer"
|
||||
httperror "github.com/portainer/portainer/http/error"
|
||||
"github.com/portainer/portainer/http/request"
|
||||
"github.com/portainer/portainer/http/response"
|
||||
)
|
||||
|
||||
// POST request on /api/upload/tls/{certificate:(?:ca|cert|key)}?folder=<folder>
|
||||
|
@ -21,7 +21,7 @@ func (handler *Handler) uploadTLS(w http.ResponseWriter, r *http.Request) *httpe
|
|||
return &httperror.HandlerError{http.StatusBadRequest, "Invalid query parameter: folder", err}
|
||||
}
|
||||
|
||||
file, err := request.RetrieveMultiPartFormFile(r, "file")
|
||||
file, _, err := request.RetrieveMultiPartFormFile(r, "file")
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusBadRequest, "Invalid certificate file. Ensure that the certificate file is uploaded correctly", err}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue