X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FREST.pm;h=508d2ff47655aafec7486cc9bd144a945fbf9c80;hb=258f6e7c203bb2a0a29d2eccd0f1f029a13275b9;hp=be267c1a1088886a834dd0c88880e7de4d876435;hpb=44fa7f9429568532ea892e2020c20177b71cb736;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/REST.pm b/lib/Catalyst/Action/REST.pm index be267c1..508d2ff 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -152,8 +152,13 @@ sub _dispatch_rest_method { sub get_allowed_methods { my ( $self, $controller, $c, $name ) = @_; my $class = ref($controller) ? ref($controller) : $controller; - my $methods = Class::Inspector->methods($class); - return map { /^$name\_(.+)$/ } @$methods; + my $methods = { + map { /^$name\_(.+)$/ ? ( $1 => 1 ) : () } + @{ Class::Inspector->methods($class) } + }; + $methods->{'HEAD'} = 1 if $methods->{'GET'}; + delete $methods->{'not_implemented'}; + return keys %$methods; }; sub _return_options {