X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FREST.pm;h=9f866a129dcd10df71b99f321aa5a99576760ca7;hb=47c3e6b3694ea55015f839be8f1a10e4141e6e4a;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..9f866a1 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -10,7 +10,7 @@ use Catalyst::Controller::REST; BEGIN { require 5.008001; } -our $VERSION = '1.04'; +our $VERSION = '1.12'; $VERSION = eval $VERSION; sub BUILDARGS { @@ -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 sort keys %$methods; }; sub _return_options {