Skip to content

Commit

Permalink
Remove not_implemented from the list of allowed methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wreis authored and Wallace Reis committed Jul 2, 2012
1 parent a08d447 commit 258f6e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Catalyst/Action/REST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
7 changes: 7 additions & 0 deletions t/lib/Test/Catalyst/Action/REST/Controller/REST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 258f6e7

Please sign in to comment.