perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Maas" <frank.m...@cheiron-it.nl>
Subject RE: [mp2] 2nd content_type is ignored?
Date Fri, 28 Apr 2006 15:48:47 GMT
>> This object does some basic things for generating XML, hence the
>> content_type. This, again, works fine. Now the problem - if an
>> unexisting action for this "XML subclass" is requested, the AUTOLOAD
>> kicks in. The AUTOLOAD sets the content-type back to HTML
>> ($r->content_type('text/html')) but this is completely ignored...

Solved my own problem, but thought sharing would be good... Apparently it was not the content_type
call that was ignored. What happens is that Apache does an add_output_filter_by_type on each
call to ap_set_content_type (which is the Apache equivalent of $r->content_type). Output
filters are however never removed... So if you have (like I did) an output filter for a specific
type then this happens:

	$r->content_type('my/type');	 # content_type set AND output filter added
	$r->content_type('text/html'); # content_type changed, output filter REMAINS

I don't know if this behaviour is as one would expect and it certainly is not a discussion
for this list (as it is standard Apache behaviour) but worth to know...

Thanks Frank W. for sharing your thoughts.

Regards,
Frank M.



Mime
View raw message