From 1dad1ca5b9eb3c516b8a33b4b5eedc05c6ce772f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 27 May 2014 09:43:47 +0200 Subject: [PATCH] add additional check for duplicate method definitions If we have a SUBCLASS, other methods are not allowed. --- data/PVE/RESTHandler.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/PVE/RESTHandler.pm b/data/PVE/RESTHandler.pm index 91b269e..23a29ea 100644 --- a/data/PVE/RESTHandler.pm +++ b/data/PVE/RESTHandler.pm @@ -218,6 +218,11 @@ sub register_method { die "$errprefix duplicate method definition\n" if defined($path_lookup->{$method}); + if ($method eq 'SUBCLASS') { + foreach my $m (qw(GET PUT POST DELETE)) { + die "$errprefix duplicate method definition SUBCLASS and $m\n" if $path_lookup->{$m}; + } + } $path_lookup->{$method} = $info; $info->{match_re} = $match_re; -- 2.39.2