[cgiapp] Re: CGI::Application::Server bug with regards to $self->query?

Mark Stosberg mark at summersault.com
Thu Dec 4 11:13:00 EST 2008


> Actually now that I've looked at it, I think the problem is actually in 
> CGI::Application not ::Server.  The query object is initialized in new() 
> shouldn't this actually happen in run()?

I would say the bug is here, in CGI::Application::Server

 if (!defined blessed $target) {
 	    return $self->_serve_response($target->new->run);
 } else {
        # Missing line:
        $target->cgiapp_get_query;
 	    return $self->_serve_response($target->run);
 }

The calling of cgiapp_get_query *is* delayed until run()... really until the
first time you call "query()". There is no way to detect you need a fresh query
object.  The server needs to take care of that. 

    Mark




More information about the cgiapp mailing list