hi all!
the problem is me. the handler works fine with a full, existing path. the
problem occurs when i think that a request for a directory is just like a
request for a file, which is isn't.
basically, i need to handle setting cookies with a redirect, then this
problem along with a related one for images go away.
sorry to bother you all,
aaron
> hi Tim!
>
> tried it. didn't work.
>
> what difference were you thinking that might make? maybe there is another
> way to achieve it.
>
> Aaron
>
> > Try retrieving the content type and then working on that scalar.
> >
> > my $ct = $r->content_type;
> > return -1 if ((-e $r->finfo) && $ct && ($ct !~ m|^text/|i));
> >
> >
> > Thanks,
> >
> > Tim Tompkins
> > ----------------------------------------------
> > Programmer / IS Technician
> > http://www.arttoday.com/
> >
> >
> > ----- Original Message -----
> > From: Aaron Ross <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, February 10, 2000 10:16 AM
> > Subject: $r->content_type clobbering outgoing headers
> >
> >
> > > Hi!
> > >
> > > I have an access handler that uses $r->headers_out->add to add a
> > set-cookie
> > > header:
> > >
> > > $r->headers_out->add("Set-cookie"=>$sesc);
> > >
> > > If i try to access this in my ContentHandler, actually HTML::Mason, i
> > find
> > > a strange problem: Calling $r->content_type wipes out the header!
> > >
> > > >From the handler.pl:
> > >
> > > sub handler
> > > {
> > > my ($r) = @_;
> > >
> > > $r->headers_out->do(sub { my ($k,$v) = @_; $r->log_error("OUT:
> > $k=>$v"); 1; });
> > >
> > > return -1 if -e $r->finfo && $r->content_type && $r->content_type !~
> > m|^text/|i;
> > >
> > > $r->headers_out->do(sub { my ($k,$v) = @_; $r->log_error("OUT:
> > $k=>$v"); 1; });
> > >
> > > .... snip ....
> > >
> > > }
> > >
> > > The first do call works fine returning something like this:
> > >
> > > [Thu Feb 10 12:11:47 2000] [error] OUT:
> > Set-cookie=>MF_Session=14&950202707; domain=.mathforum.com; path=/
> > >
> > > The second returns nothing at all.
> > >
> > > Commenting out the content-type line fixes the problem... However, I like
> > > that line and want it to stay!!!
> > >
> > > TIA,
> > > Confused in Swarthmore, aka Aaron
> > >
> > >