add additional check for duplicate method definitions

If we have a SUBCLASS, other methods are not allowed.
This commit is contained in:
Dietmar Maurer 2014-05-27 09:43:47 +02:00
parent 212fc0b77e
commit 1dad1ca5b9

View File

@ -218,6 +218,11 @@ sub register_method {
die "$errprefix duplicate method definition\n" die "$errprefix duplicate method definition\n"
if defined($path_lookup->{$method}); 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; $path_lookup->{$method} = $info;
$info->{match_re} = $match_re; $info->{match_re} = $match_re;