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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Fri Apr 19 15:01:28 2024 UTC