]> git.proxmox.com Git - pve-common.git/blobdiff - data/PVE/RESTHandler.pm
add additional check for duplicate method definitions
[pve-common.git] / data / PVE / RESTHandler.pm
index 91b269ea2ab3d0d6ee6ac0b0ea219aaf027ae3b9..23a29ea73a5ac2de249102193c3c1522de19fdef 100644 (file)
@@ -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;