unfortunately, I am not entirely sure what a cgi is going  to output all the
time. The cgi might try to do a redirect using the Location field. Therefore,
I don't think I can simply send_http_headers as type text/html...

thanx, though
-amen

Rick Myers wrote:

> On Aug 20, 2000 at 19:38:53 -0700, Alex Menendez twiddled the keys to say:
> > cgi scripts. the module uses lookup_uri() to generate a subrequest then
> > calls  run() to output the actual contents of the file. the eagle book
> > says that calling run() on a subrequest should automatically send the
> > client the appropriate http headers and the document's body. However, I
> > have found that this is not the case. The following code does not send
> > http headers for both cgis and html docs. The body stuff is working fine
> > but the headers are not being sent:
> >
> >         my $uri = $r->uri;
> >         unless(!$r->args) {
> >             $uri = $uri .'?'.$r->args;
> >         }
> >         my $subr = $r->lookup_uri($uri);
> >         if($r->dir_config('is_cgi')) {
> >             $subr->handler('cgi-script');
> >         } else {
> >             $subr->handler('server-parsed');
> >         }
> >         $subr->run();
> >         my $status = $subr->status;
> >         $r->print(&create_img_tag($file,$SCRIPT_ON,$status));
> >         return $status;
> >
> > any ideas?
>
> Yes. run() no longer sends headers (as far as I know). I don't know when
> it was changed, but it pre-dates my experience. I've had the following
> working just fine for close to a year now (or maybe my sense of time is
> warped :).
>
>   my $lookup = $r->lookup_uri( $uri );
>   $r->send_http_header( 'text/html' );
>   my $status = $lookup->run;
>   $r->status( $status );
>
> Rick Myers                            [EMAIL PROTECTED]
> ----------------------------------------------------
> The Feynman Problem       1) Write down the problem.
> Solving Algorithm         2) Think real hard.
>                           3) Write down the answer.

Reply via email to