Hi James

On Thu, 2011-03-10 at 20:15 -0800, James.Q.L wrote:
> --- On Sat, 3/5/11, Ron Savage <[email protected]> wrote:
> 
> > From: Ron Savage <[email protected]>
> > Subject: Re: [cgiapp] cgi::application::dispatch doesn't handle start_mode
> > To: "CGI Application" <[email protected]>
> > Date: Saturday, March 5, 2011, 6:40 PM
> > Hi James
> > 
> > On Sat, 2011-03-05 at 01:25 -0800, James.Q.L wrote:
> > > Hi, 
> > > 
> > > It seems that C::A::D always sets the runmode to
> > $rm_HTTP_METHOD even when $rm is not set, which produces a
> > _HTTP_METHOD runmode. that' doesn't work when start_mode is
> > expected to be run. it is due to the following code in the
> > sub dispatch { } from CAD,
> > > 
> > >         if( $auto_rest )
> > {
> > >             my
> > $method_lc = defined $named_args->{auto_rest_lc} ?
> > $named_args->{auto_rest_lc} : $args{auto_rest_lc};
> > >             my
> > $http_method = $self->_http_method;
> > >         
> >    $http_method = lc $http_method if
> > $method_lc;
> > >         
> >    $rm .= "_$http_method";
> > >         }
> > > 
> > > I just had to change the first line to 
> > > 
> > > if( $auto_rest && $rm )
> > > 
> > > 
> > > doesn't anyone see this as a problem?
> > 
> > Is it possible that the problem is in your code (JS, Perl),
> > in that it
> > does not provide enough information for C::A::D to set the
> > run mode?
> > 
> 
> sorry for the late reply.

No problem.

> without auto_rest set, C::A::D works with no rm defined in the dispatch rule 
> and set the rm to the startmode if it is set in the dispatched module. 
> 
> '/people/:people/:rm?' => { app => 'User' },
> 
> with auto_rest and no rm => in dispatch rule, as I said in my previous email, 
> C::A::D sets the rm to $rm_HTTP_METHOD which becomes _GET _PUT etc... 

That's OK. I just wanted you (and me) to be sure.

I will look at it, but I don't maintain C::A::D. I do strongly recommend
its use, so I certainly like to know people can rely on it.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622


#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to