From b844d237e223dd43f79f38c3f3b879a39ddb8c3f Mon Sep 17 00:00:00 2001 From: y-du <42994541+y-du@users.noreply.github.com> Date: Wed, 7 Feb 2024 07:12:24 +0100 Subject: [PATCH] only allow alias of standard endpoint type --- handler/nginx_hdl/handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/handler/nginx_hdl/handler.go b/handler/nginx_hdl/handler.go index 2f80a4c..8686dd9 100644 --- a/handler/nginx_hdl/handler.go +++ b/handler/nginx_hdl/handler.go @@ -219,6 +219,9 @@ func (h *Handler) addAlias(ctx context.Context, pID, path string, eType lib_mode if !ok { return lib_model.NewNotFoundError(errors.New("endpoint not found")) } + if e.Type != lib_model.StandardEndpoint { + return lib_model.NewInvalidInputError(errors.New("invalid parent type")) + } endpointsCopy := make(map[string]endpoint) for eID, e2 := range h.endpoints { endpointsCopy[eID] = e2