mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-27 06:34:02 +00:00
add additional check for duplicate method definitions
If we have a SUBCLASS, other methods are not allowed.
This commit is contained in:
parent
212fc0b77e
commit
1dad1ca5b9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user