Skip Menu |

This queue is for tickets about the CGI-Application-Dispatch CPAN distribution.

Report information
The Basics
Id: 71668
Status: stalled
Priority: 0/
Queue: CGI-Application-Dispatch

People
Owner: MARKSTOS [...] cpan.org
Requestors: danrumney [...] warpmail.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 3.07
Fixed in: (no value)



Right now, CGI::Application::Dispatch will return a 404 error... Show quoted text
> When the path does not match anything in the "DISPATCH TABLE", or > module could not be found in @INC, or run mode did not exist.
My dispatch table does method matching and I'd prefer it if I could return a 405 error the HTTP client attempts to use a PUT on one of my resources. I know that I could create a 'method_not_supported' runmode, but it would be nice if this module could handle that explicitly for me.
Subject: Re: [rt.cpan.org #71668]
Date: Fri, 14 Oct 2011 09:14:28 -0400
To: bug-CGI-Application-Dispatch [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> Right now, CGI::Application::Dispatch will return a 404 error... >
>> When the path does not match anything in the "DISPATCH TABLE", or >> module could not be found in @INC, or run mode did not exist.
> > My dispatch table does method matching and I'd prefer it if I could > return a 405 error the HTTP client attempts to use a PUT on one of my > resources. > > I know that I could create a 'method_not_supported' runmode, but it > would be nice if this module could handle that explicitly for me.
Thanks for the feedback, Dan. How would you like CGI::App::Dispatch to handle this better for you? How would you expect the dispatcher to decide when to return a 404 vs a 405? Mark
From: danrumney [...] warpmail.net
On Fri Oct 14 09:14:38 2011, mark@summersault.com wrote: Show quoted text
>
> > Right now, CGI::Application::Dispatch will return a 404 error... > >
> >> When the path does not match anything in the "DISPATCH TABLE", or > >> module could not be found in @INC, or run mode did not exist.
> > > > My dispatch table does method matching and I'd prefer it if I could > > return a 405 error the HTTP client attempts to use a PUT on one of my > > resources. > > > > I know that I could create a 'method_not_supported' runmode, but it > > would be nice if this module could handle that explicitly for me.
> > Thanks for the feedback, Dan. > > How would you like CGI::App::Dispatch to handle this better for you? > How would you expect the dispatcher to decide when to return a 404 vs
a 405? Show quoted text
> > Mark
I did some further searching and it seems that CGI::Application::Plugin::REST might be what I'm *really* looking for. However, perhaps something like: ':app/news[delete]' => { rm => 'delete_news' }, ':app/news[post]' => { rm => 'add_news' }, ':app/news[get]' => { rm => 'news' }, ':app/news[put]' => { error => 405 }, i.e. it would be for the developer to explicitly mark methods as unsupported. Alternatively, the mere presence of a method filter for a resource, such as: ':app/resource[get]' => { rm => 'resource' }, would tell CGI::App::Dispatch that all *other* methods should return a 405. If you're interested, I could look into writing a patch
Subject: Re: [rt.cpan.org #71668]
Date: Fri, 14 Oct 2011 13:19:56 -0400
To: bug-CGI-Application-Dispatch [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> Alternatively, the mere presence of a method filter for a resource, such as: > > ':app/resource[get]' => { rm => 'resource' }, > > would tell CGI::App::Dispatch that all *other* methods should return a 405. > > If you're interested, I could look into writing a patch
I agree. Thanks for working on the patch. Ideally, it will include some test and doc updates as well, and a version for CGI::Application::Dispatch::PSGI, which shares some duplicate code. Thanks, Mark
I'm noting that this is stalled while a patch is being developed.