php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67632 response from dispatcher doesn't send custom headers
Submitted: 2014-07-16 13:58 UTC Modified: -
From: chazmead89 at gmail dot com Assigned:
Status: Open Package: yaf (PECL)
PHP Version: Irrelevant OS: Mac OSX - Maverick
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-07-16 13:58 UTC] chazmead89 at gmail dot com
Description:
------------
Response headers assigned the the Yaf_Reponse_Http object are not automatically being sent with the dispatchers response, which means I must bootstrap Yaf_Dispatcher::returnResponse(TRUE); and call Yaf_Response_Http::response(); from the controller  (Also on a side note, the flag in the Yaf_Dispatcher::returnResponse() should be TRUE to tell dispatcher to send, and FALSE to say not send??? slightly misleading the other way around... or call the method disableResponse()).

I'm not sure if this is a bug, or some kind of strange feature... but I think headers should be sent automatically from the dispatcher, to be controlled with the property Yaf_Response_Http::_sendheader with a setter Yaf_Response_Http::sendheader(boolean $flag=true);

Test script:
---------------
class HomeController extends Yaf_Controller_Abstract {
  function indexAction() {
    $this->getResponse()->setHeader('X-Test','testheader');
    $this->getResponse()->setBody('Hello World');
  }
}

Expected result:
----------------
Headers sent to browser:  X-Test: testheader

Actual result:
--------------
Header not sent to browser.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 12:01:29 2024 UTC