From: Wallace Reis Date: Mon, 2 Jul 2012 18:06:46 +0000 (+0200) Subject: Remove not_implemented from the list of allowed methods X-Git-Tag: 1.05~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=commitdiff_plain;h=258f6e7c203bb2a0a29d2eccd0f1f029a13275b9 Remove not_implemented from the list of allowed methods --- diff --git a/lib/Catalyst/Action/REST.pm b/lib/Catalyst/Action/REST.pm index 9c5c86a..508d2ff 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -157,6 +157,7 @@ sub get_allowed_methods { @{ Class::Inspector->methods($class) } }; $methods->{'HEAD'} = 1 if $methods->{'GET'}; + delete $methods->{'not_implemented'}; return keys %$methods; }; diff --git a/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm b/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm index ad168c1..c91c42f 100644 --- a/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm +++ b/t/lib/Test/Catalyst/Action/REST/Controller/REST.pm @@ -83,4 +83,11 @@ sub opts_GET { $self->status_ok( $c, entity => { opts => 'worked' } ); } +sub opts_not_implemented { + my ( $self, $c ) = @_; + $c->res->status(405); + $c->res->header('Allow' => [qw(GET HEAD)]); + $c->res->body('Not implemented'); +} + 1;