You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "R.Munden" <or...@netorbit.com> on 2002/01/14 04:14:51 UTC

DECLINED unless 'text/html' but images never make it

I've a script (controlled by a <Location> directive) that wraps a standard
header and footer around an HTML page

I've this at the top of my script:

my $r = shift;
 return DECLINED unless ($r->content_type() eq 'text/html');

but any images that may be inline never make it to the browser (also, if I
explicitly call the image in question it never makes it to the browser).

Apache gives a 200 status code for these requests in the access log but
Netscape 6.2 just sits there and IE returns a 'Cannot find server...' error.

Any ideas, where to start looking, etc.?

--rjm--





Re: DECLINED unless 'text/html' but images never make it

Posted by Mark Maunder <ma...@swiftcamel.com>.
Seems wierd. I do this quite succesfully myself, although I did have problems
when compressing images and html together using Apache::Compress - similar
symptom to yours. Are you doing anything else in the handler?  Have you stripped
this down to the most basic form e.g. a handler that prints out 'hello world'
with a single IMG tag in the html perhaps? And there's nothing in the error_log
at all? Try sticking some code in before and after 'return DECLINED' - something
like:

$r->log_error("Serving content type: " . $r->content_type() . " for uri " .
$r->uri() ) ;

So you can see what's being requested. Also, what does your httpd.conf look
like?

Be aware that if your client requests the / uri, the mime type that you get is
not text/html but httpd/unix-directory. You may want to change the way it works
to specifying what you explicitly don't handle (I recommend using regex here)
rather than what you do.

~mark.

"R.Munden" wrote:

> I've a script (controlled by a <Location> directive) that wraps a standard
> header and footer around an HTML page
>
> I've this at the top of my script:
>
> my $r = shift;
>  return DECLINED unless ($r->content_type() eq 'text/html');
>
> but any images that may be inline never make it to the browser (also, if I
> explicitly call the image in question it never makes it to the browser).
>
> Apache gives a 200 status code for these requests in the access log but
> Netscape 6.2 just sits there and IE returns a 'Cannot find server...' error.
>
> Any ideas, where to start looking, etc.?
>
> --rjm--





Re: DECLINED unless 'text/html' but images never make it

Posted by Igor Sysoev <is...@rambler-co.ru>.
On Mon, 14 Jan 2002, Jon Robison wrote:

> How about trying:
> 
> return DECLINED unless $r->is_initial_req;
> 
> Image calls are not initial requests, they are sub requests.

No. Requests for inline images are not subrequests.

> --Jon Robison
> 
> 
> "R.Munden" wrote:
> > 
> > I've a script (controlled by a <Location> directive) that wraps a standard
> > header and footer around an HTML page
> > 
> > I've this at the top of my script:
> > 
> > my $r = shift;
> >  return DECLINED unless ($r->content_type() eq 'text/html');
> > 
> > but any images that may be inline never make it to the browser (also, if I
> > explicitly call the image in question it never makes it to the browser).
> > 
> > Apache gives a 200 status code for these requests in the access log but
> > Netscape 6.2 just sits there and IE returns a 'Cannot find server...' error.

Igor Sysoev


Re: DECLINED unless 'text/html' but images never make it

Posted by Jon Robison <jr...@uniphied.com>.
How about trying:

return DECLINED unless $r->is_initial_req;

Image calls are not initial requests, they are sub requests.

--Jon Robison


"R.Munden" wrote:
> 
> I've a script (controlled by a <Location> directive) that wraps a standard
> header and footer around an HTML page
> 
> I've this at the top of my script:
> 
> my $r = shift;
>  return DECLINED unless ($r->content_type() eq 'text/html');
> 
> but any images that may be inline never make it to the browser (also, if I
> explicitly call the image in question it never makes it to the browser).
> 
> Apache gives a 200 status code for these requests in the access log but
> Netscape 6.2 just sits there and IE returns a 'Cannot find server...' error.
> 
> Any ideas, where to start looking, etc.?
> 
> --rjm--

-- 
Disclaimer: Any resemblance between the above views and
those of my employer, my terminal, or the view out my
window are purely coincidental.  Any resemblance between
the above and my own views is non-deterministic.  The
question of the existence of views in the absence of anyone
to hold them is left as an exercise for the reader. The
question of the existence of the reader is left as an
exercise for the second god coefficient.  (A discussion
of non-orthogonal, non-integral polytheism is beyond the
scope of this article.)