Hi!

I have a question regarding the Zend_Controller_Response_Abstract object and 
it's ability to  generates http headers

Components that directly set headers via php build-in header() method are out 
of reach from this object and I wonder if an addition would be useful.

The use case :
I have a general plugin that cleans HTML with the tidy extention.
This plugin checks the response object for registered headers because not all 
content needs to be cleaned. Only content with the Content-Type 'text/html' or 
'application/xhtml+xml'

Now, some route points to a Zend_Amf service. This server set headers directly. 
It specifies 'Cache-Control: cache, must-revalidate', 'Pragma: public', 
'Content-Type: application/x-amf'.

The problem : 
My plugin still tidies the content, because the Content-Type header isn't 
register in the response object.

Solution 1 :
I could adapt my plugin to also check the headers_list() method. This wil work, 
but I would need to duplicate some code and other use cases might encouter the 
same situation.

Solution 2 :
A modification to Zend_Controller_Response_Abstract where any queries to 
getting headers include the headers_list(). 

a method would need to be created to suckup any headers in the header_list into 
it's own local _header property.

This method needs to be called at crucial times, such as 
Zend_Controller_Response_Abstract ::getHeaders and 
Zend_Controller_Response_Abstract::sendHeader.


The only impact removal of headers in the headers_list might have is for 
components that read the headerrs_list themselves. Also header_remove is only 
available in PHP5.3.0. I don't know if header duplication is a problem.

Is this a useful adaption? And if so how would I get this written into the next 
release?

Thanks

Bas Kamer


bushbaby multimedia ontwerp & uitvoering
[email protected] | +31(0)6 2897 7426

Reply via email to