ZF-7450: Action helper contextswitch - Headers of context xml can not be modified
Description
Though context xml is removed and then added with new headers, the headers are not acknowledged.
Works fine for the other default context json and all new context switches though:
$contextSwitch->removeContext('xml');
$contextSwitch->removeContext('json');
$context = 'xml';
$spec = array(
'headers' => array(
'Content-type' => 'text/xml',
'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT',
'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT',
'Cache-Control' => 'no-cache, must-revalidate',
'Pragma' => 'no-cache'
),
'callbacks' => array(
'post' => array($this,'showXml')
)
);
$contextSwitch->addContext($context, $spec);
$context = 'json';
$spec = array(
'headers' => array(
'Content-type' => 'text/json',
'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT',
'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT',
'Cache-Control' => 'no-cache, must-revalidate',
'Pragma' => 'no-cache'
),
'callbacks' => array(
'post' => array($this,'showJson')
)
);
$contextSwitch->addContext($context, $spec);
wrong for xml: curl -I "http://url/format/xml" HTTP/1.1 200 OK Date: Mon, 03 Aug 2009 09:17:30 GMT Server: Apache Vary: Accept-Encoding Content-Type: text/xml correct for json: curl -I "http://url/format/json" HTTP/1.1 200 OK Date: Mon, 03 Aug 2009 09:17:28 GMT Server: Apache Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Mon, 03 Aug 2009 09:17:28 GMT Cache-Control: no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding Content-Type: text/json
Comments
Posted by Rob Allen (rob) on 2012-11-20T20:53:02.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.