Skip to content

Commit

Permalink
only allow alias of standard endpoint type
Browse files Browse the repository at this point in the history
  • Loading branch information
y-du committed Feb 7, 2024
1 parent e75901f commit b844d23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handler/nginx_hdl/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b844d23

Please sign in to comment.