Issues

ZF-7450: Action helper contextswitch - Headers of context xml can not be modified

Issue Type: Bug Created: 2009-08-03T02:38:15.000+0000 Last Updated: 2012-11-20T20:53:02.000+0000 Status: Closed Fix version(s): Reporter: Michael Schmidt (unschuldsengel) Assignee: None Tags: - Zend_Controller

Related issues: Attachments:

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:

<pre class="highlight"> 
$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);



<pre class="literal">
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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts