mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(endpoint-status): add a redirect to keep backwards compatibility EE-2932 (#6735)
This commit is contained in:
parent
dff74f0823
commit
9ffaf47741
2 changed files with 25 additions and 0 deletions
21
api/http/handler/endpoints/endpoint_status_inspect.go
Normal file
21
api/http/handler/endpoints/endpoint_status_inspect.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package endpoints
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
"github.com/portainer/libhttp/request"
|
||||
)
|
||||
|
||||
// DEPRECATED
|
||||
func (handler *Handler) endpointStatusInspect(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
|
||||
endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusBadRequest, "Invalid environment identifier route variable", err}
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("/api/endpoints/%d/edge/status", endpointID)
|
||||
http.Redirect(w, r, url, http.StatusPermanentRedirect)
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue