Xavier Noria wrote:
[EMAIL PROTECTED] wrote:

It seems to me that $r->content-type is for what your server sends to the
client, which is probably undef in the Fixup stage, where you test it.

You probaly meant to test for the
$ct = $r->header_in("Content-type")
if you wanted to see whats requested from the client.

Content-Type is an entity header, so it can apply to both incoming and outgoing headers. however, it's more generally seen as an outgoing header for normal web activity, leaving headers_in empty.




But then, there are examples in the books that use that method that way.

For instance, in recipe 14.1 of the Cookbook, which is about how to disable a configured mod_perl PerlHandler, the "Technique" section says:

  Set the handler back to the default Apache content handler from a
  PerlFixupHandler.

  # Only run the PerlHandler for HTML.
  # For everything else, run the default Apache content handler.
  $r->handler('default-handler') unless $r->content_type eq 'text/html';

I think in the Eagle book there is some code like that as well, cannot check it right now however.

So, looks like that test makes sense, or can make sense, in that handler.

$r->content_type is generally set by mod_mime, during the mime-type phase, according to it's rules. for most setups, it should be set to something by fixup, but I guess it's dependent on your particular settings.


--Geoff



Reply via email to