Development

#4864 (use HTTP/1.0 or HTTP/1.1 in sfWebResponse::sendHttpHeaders() based on configuration)

You must first sign up to be able to contribute.

Ticket #4864 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

use HTTP/1.0 or HTTP/1.1 in sfWebResponse::sendHttpHeaders() based on configuration

Reported by: Adlan Assigned to: fabien
Priority: minor Milestone: 1.1.5
Component: configuration Version: 1.1.4
Keywords: Cc:
Qualification: Unreviewed

Description

sfWebResponse forces HTTP 1.1 in sendHttpHeaders. Any chance to make this behaviour configurable to make it possible to choose between 1.0 and 1.1 versions of http? A lot of people use reverse proxies such as nginx and nginx particularly expects HTTP/1.0 reply from backend, and if the reply is chunked as in http/1.1 the output will be garbaged. A simple workaround for this is to inherit from sfWebResponse, override sendHttpHeaders and define the new response class in factories.yml, but having almost exact copy of overriden method does not play nicely with DRY principle.

Change History

11/07/08 22:03:40 changed by Adlan

  • status changed from new to closed.
  • resolution set to invalid.

please disregard the last sentence, apache sends last set status in header

parent::sendHttpHeaders();
$status = 'HTTP/1.0 '.$this->statusCode.' '.$this->statusText;
header($status);

does the job
but still it would be nice to have this configurable. ps. sfException::printStackTrace() also forces HTTP/1.1

11/08/08 10:38:35 changed by fabien

It has been fixed in r11955 and will be in 1.1.5 and 1.2.0.

11/08/08 10:38:44 changed by fabien

  • resolution changed from invalid to fixed.

(In [12751]) [1.1, 1.2] fixed HTTP header for exceptions (closes #4864)