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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chazmead89 at gmail dot com
New email:
PHP Version: OS:

 

 [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 06:01:30 2024 UTC