[cgiapp] REST tunneling in CGI::Application::Dispatch

Timothy Appnel tim at appnel.com
Mon Jul 11 12:46:26 EDT 2011


I feel like this is making a mountain out of a mole hill right now. I went to great lengths to make this contribution as small as possible and dependency free in hopes of getting this put thru without a lot of hassle. That hasn't worked here though. 

So what are the objections and can it get out of pull request limbo?

<tim/>

Sent from my iPhone

On Jul 1, 2011, at 2:55, "Jaldhar H. Vyas" <jaldhar at braincells.com> wrote:

> On Thu, 30 Jun 2011, Mark Stosberg wrote:
> 
>> How would you recommend he use REST::Util here. His "diff" is only a few
>> lines and does very little. See it here:
>> 
>> https://github.com/tima/CGI--Application--Dispatch/commit/1e906a01f9470b3b15894e4c77e10c0e8468c86b
>> 
> 
> This bit:
> 
>             if($tunneling && $http_method eq 'POST') {
>                 $rm = sub {
>                     my $self = shift;
>                     my $rest_method = $self->query->param('_method') ||
>                     'POST';
>                     $rest_method = lc $rest_method if $method_lc;
>                     return $rm.'_'.$rest_method;
>                 };
>             } else {
>                 $http_method = lc $http_method if $method_lc;
>                 $rm .= "_$http_method";
>             }
> 
> could be replaced by:
> 
>             if($tunneling && $http_method eq 'POST') {
>                 my $rest_method = request_method($self->query);
>                 $rest_method = lc $rest_method if $method_lc;
>                 return $rm.'_'.$rest_method";
>             } else {
>                 $http_method = lc $http_method if $method_lc;
>                 $rm .= "_$http_method";
>             }
>         }
> 
> This gets you a wider variety of tunneling behaviors.  (see the docs for 
> request_method in REST::Utils)
> 
> The bigger win would be to enable C::A::Dispatch to dispatch based on MIME 
> type but that would require a more invasive patch.
> 
> -- 
> Jaldhar H. Vyas <jaldhar at braincells.com>
> 
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
> 


More information about the cgiapp mailing list