X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FREST.pm;h=6882442a1b79891961ab2460a913f8c6c0dc7452;hb=cc188065d548c2c53c22000871a7d6dfab5c3c69;hp=09a4deb57494cf263b44def7871db938189fc8f3;hpb=9e4398c862fc57d6f9d83f9c64ab3e5e858b9862;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/REST.pm b/lib/Catalyst/Action/REST.pm index 09a4deb..6882442 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -10,8 +10,7 @@ use Catalyst::Controller::REST; BEGIN { require 5.008001; } -our $VERSION = '1.03'; -$VERSION = eval $VERSION; +# VERSION sub BUILDARGS { my $class = shift; @@ -152,8 +151,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 {