mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
fix(aeec): enforce non-empty EdgeIDs for global key environment retrieval EE-3013 (#6808)
This commit is contained in:
parent
bcec6a8915
commit
5b77edb76d
2 changed files with 34 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package endpoints
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
|
@ -21,6 +22,9 @@ type endpointCreateGlobalKeyResponse struct {
|
|||
// @router /endpoints/global-key [post]
|
||||
func (handler *Handler) endpointCreateGlobalKey(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
|
||||
edgeID := r.Header.Get(portainer.PortainerAgentEdgeIDHeader)
|
||||
if edgeID == "" {
|
||||
return httperror.BadRequest("Invalid Edge ID", errors.New("the Edge ID cannot be empty"))
|
||||
}
|
||||
|
||||
// Search for existing endpoints for the given edgeID
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue