Zend Framework

Duplicate header problems with contextSwitch

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.5
  • Fix Version/s: None
  • Component/s: Zend_Controller
  • Labels:
    None

Description

When a controller with an initContext() call in the init() method forwards (or in my case, I'm using Zend_View_Helper_Action) to another controller that also calls initContext(), they send duplicate Content-type headers, which causes some servers to 500 (this particular server is using FastCGI). Would it be an appropriate fix to simply use the replace bit when setting headers from contextSwitch?

Activity

Hide
Sylvain DIDELOT added a comment -

I can confirm this bug. Happens when error controller takes over after an exception is thrown for example.

Fix is easy:

diff ContextSwitch.php ContextSwitch.php.bak 
283c283
<                 $response->setHeader($header, $content, true);
---
>                 $response->setHeader($header, $content);
Show
Sylvain DIDELOT added a comment - I can confirm this bug. Happens when error controller takes over after an exception is thrown for example. Fix is easy:
diff ContextSwitch.php ContextSwitch.php.bak 
283c283
<                 $response->setHeader($header, $content, true);
---
>                 $response->setHeader($header, $content);

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: