Subject: | PATCH action subroutine attribute not supported (patch included) |
Date: | Wed, 16 Jul 2014 15:43:43 -0600 |
To: | bug-Catalyst-Runtime [...] rt.cpan.org |
From: | "Shane Corgatelli" <shane [...] eznettools.com> |
The PATCH action attribute is documented in Catalyst::Controller. However,
it doesn't actually work. It acts like an action without a HTTP method
specified.
For example, if I have the following actions defined:
sub start :ChainedParent :PathPart('test') :CaptureArgs(0) {}
sub update :PUT :Chained('start') :PathPart('') :Args(1) {
my ( $self, $ctx, $id ) = @_;
$ctx->response->body("Matched PUT $id");
}
sub patch :PATCH :Chained('start') :PathPart('') :Args(1) {
my ( $self, $ctx, $id ) = @_;
$ctx->response->body("Matched PATCH $id");
}
results in the following:
Show quoted text
> curl -X PUT /test/1
Matched PATCH 1
Show quoted text> curl -X PATCH /test/1
Matched PATCH 1
Show quoted text> curl -X OPTIONS /test/1
Matched PATCH 1
It is easy to work around, just use :Method('PATCH') instead. However,
I've included a patch to add support to match the documentation.
Affects: Catalyst 5.90065
Thank you,
Shane Corgatelli
Programming Manager
EZ-NetTools
www.eznettools.net
EZ-NetTools - We make it easy!
Message body is not shown because sender requested not to inline it.