Development

#2817 ([PATCH] Symfony defaults to HTTP/1.0 in sfWebResponse)

You must first sign up to be able to contribute.

Ticket #2817 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

[PATCH] Symfony defaults to HTTP/1.0 in sfWebResponse

Reported by: drmikecrowe Assigned to: fabien
Priority: minor Milestone: 1.1.5
Component: controller Version: 1.2.8
Keywords: Cc:
Qualification: Unreviewed

Description

We need the ability to control the response. In a project I support, I had to manually change this to HTTP/1.1

I suggest we implement via a config variable, and default to 1.0 for backward compatibility.

Attachments

HTTPversion.diff (447 bytes) - added by OfirPicazo on 08/23/08 01:12:57.
Patch to fix hardcoded 'HTTP/1.1'

Change History

05/07/08 11:00:45 changed by FabianLange

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 1.1.0 RC1.

this is since r5707 in sf 1.1

08/23/08 01:11:31 changed by OfirPicazo

  • status changed from closed to reopened.
  • type changed from enhancement to defect.
  • resolution deleted.
  • summary changed from Symfony defaults to HTTP/1.0 in sfWebResponse to [PATCH] Symfony defaults to HTTP/1.0 in sfWebResponse.

The current behavior is not always desirable, for example when serving symfony applications through a proxy that only supports HTTP/1.0 (lighttpd 1.4). I believe symfony should respect the version of the protocol the client is requesting by using $_SERVERSERVER_PROTOCOL? instead of hardcoding version HTTP/1.1

The patch proposed is attached to this comment.

08/23/08 01:12:57 changed by OfirPicazo

  • attachment HTTPversion.diff added.

Patch to fix hardcoded 'HTTP/1.1'

10/05/08 18:10:25 changed by fabien

  • milestone changed from 1.1.0 RC1 to 1.1.5.

10/05/08 18:11:52 changed by fabien

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [11955]) [1.1, 1.2] fixed HTTP-Version in sfWebResponse broken under certain circumstances (closes #4578, #2817)

09/08/09 04:57:39 changed by zohan

  • status changed from closed to reopened.
  • version changed from 1.1.0 DEV to 1.2.8.
  • resolution deleted.
  • milestone changed from 1.1.5 to 1.2.9.

I still in trouble ( symfony 1.2.8 ). I'm getting $_SERVERSERVER_PROTOCOL? = 'HTTP/1.0' from request, but for some reason it appears at response object as 'HTTP/1.1'. Code from config_factories.yml:

  $this->factories['response'] = new $class($this->dispatcher, sfConfig::get('sf_factory_response_parameters', array_merge(array('http_protocol' => isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : null), array (
  'logging' => '1',
  'charset' => 'utf-8',
  'send_http_headers' => true,
  'content_type' => 'text/html',
  'http_protocol' => 'HTTP/1.1',
))));

okay, so lets suppose, that $_SERVERSERVER_PROTOCOL? = 'HTTP/1.0', then our response object properties will be a result of:

array_merge(array('http_protocol' => 'HTTP/1.0'), array (
  'logging' => '1',
  'charset' => 'utf-8',
  'send_http_headers' => true,
  'content_type' => 'text/html',
  'http_protocol' => 'HTTP/1.1',
)))

So, we can see here, that there is no difference about $_SERVERHTTP_PROTOCOL?, because it will be always overriden by 'HTTP/1.1' , he-he ...

09/14/09 00:02:47 changed by FabianLange

  • status changed from reopened to closed.
  • resolution set to fixed.
  • milestone changed from 1.2.9 to 1.1.5.

back to fixed. The parameters that are merged with are the ones from your factories.yml They are thought to override anything. and in this case even the server_protocol. if you dont define it, then it wont show up in parameters and will leave you alone :)