Commit Graph

88 Commits

Author SHA1 Message Date
Fabien Potencier
d7a5449dda [HttpFoundation] tweaked previous merge 2012-07-15 09:31:47 +02:00
Pierre Rineau
7d53909d47 Earlier PHP output buffer flush for non FPM environments 2012-07-14 14:47:09 +02:00
Fabien Potencier
d100ffaf76 fixed CS 2012-07-09 14:54:20 +02:00
Fabien Potencier
5a8e20643e merged branch adrienbrault/http-foundation-fixes (PR #4483)
Commits
-------

9a74b85 [HttpFoundation] CS and phpdoc fixes

Discussion
----------

[HttpFoundation] CS and phpdoc fixes

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

Hey

---------------------------------------------------------------------------

by travisbot at 2012-06-02T00:30:49Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1504379) (merged 2f0117f2 into 1541fe26).

---------------------------------------------------------------------------

by fabpot at 2012-06-25T14:53:18Z

@adrienbrault Can you have a look at my comments?

---------------------------------------------------------------------------

by adrienbrault at 2012-06-25T16:24:49Z

Done! Sorry for the delay

---------------------------------------------------------------------------

by travisbot at 2012-06-25T17:50:24Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1702850) (merged 9a74b851 into 58436de1).
2012-06-25 22:29:10 +02:00
Adrien BRAULT
9a74b851e6 [HttpFoundation] CS and phpdoc fixes 2012-06-25 18:21:41 +02:00
Fabien Potencier
0f67ca88c1 [HttpFoundation] fixed StreamedResponse with HEAD as a method (closes #4502) 2012-06-13 16:21:50 +02:00
Jordan Alliot
5d55726183 [HttpFoundation] Added 308 as a valid redirect code 2012-06-10 01:20:06 +03:00
Fabien Potencier
3bdf52a16a fixed CS 2012-05-18 19:42:42 +02:00
Fabien Potencier
ec36ae7eda merged 2.0 2012-05-18 19:04:58 +02:00
Fabien Potencier
980a062092 merged branch ouardisoft/2.0 (PR #4300)
Commits
-------

d1c831d Change must-proxy-revalidate by proxy-revalidate

Discussion
----------

Change must-proxy-revalidate by proxy-revalidate

---------------------------------------------------------------------------

by travisbot at 2012-05-16T09:20:54Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1344060) (merged d1c831d7 into 8cd6cbcf).
2012-05-16 11:25:06 +02:00
ouardisoft
d1c831d7b2 Change must-proxy-revalidate by proxy-revalidate 2012-05-16 09:17:19 +00:00
Fabien Potencier
41621e42e9 fixed phpdoc @param alignment 2012-05-15 22:19:31 +02:00
Fabien Potencier
ce9791246b fixed phpdoc @param alignment 2012-05-15 18:56:32 +02:00
Fabien Potencier
f273edc176 [HttpFoundation] added missing RFC reference 2012-05-05 10:20:38 +02:00
Fabien Potencier
503a51fa29 [HttpFoundation] updated RFC references in Response 2012-05-05 08:22:03 +02:00
Marc Abramowitz
1863b28e97 Fix typo: Resonse -> Response 2012-04-18 13:38:08 -07:00
Larry Garfield
a0d047b06f Return from Response::prepare() so that the method may be chained. 2012-04-16 19:22:20 -05:00
Grégoire Pineau
c73748fd22 [HttpFoundation] Added RFC reference to 308 2012-03-29 12:05:33 +02:00
Grégoire Pineau
468ad40405 [HttpFoundation] Added support for 308 / Permanent Redirect 2012-03-29 12:18:49 +03:00
Fabien Potencier
0ba5096fe6 fixed CS 2012-03-15 17:42:47 +01:00
Jordi Boggiano
873da434cd [HttpFoundation] Add chainability to the Response class 2012-03-15 16:27:06 +01:00
Drak
0761b8a107 [HttpFoundation] Restore compliance with RFC2324 2012-03-11 11:04:36 +05:45
Markus Lanthaler
bc62effcf8 [HttpFoundation] Complete HTTP status code translation table (fix #2552)
The HTTP status code translation table was updated to include all HTTP status codes as defined by the IANA Hypertext Transfer Protocol (HTTP) Status Code Registry (http://www.iana.org/assignments/http-status-codes/).
2012-03-10 20:09:53 +08:00
Fabien Potencier
f373085928 merged 2.0 2012-02-22 18:59:56 +01:00
Christophe Coevoet
8e34f43723 Fixed the phpdoc for the Response class 2012-02-12 02:04:15 +01:00
Fabien Potencier
9c3c53a5c1 merged 2.0 2012-01-17 11:23:18 +01:00
Fabien Potencier
733ac9de7a [HttpFoundation] fixed exception message (closes #3123) 2012-01-16 22:09:07 +01:00
Fabien Potencier
5fa0f2d92b merged 2.0 2012-01-16 07:44:08 +01:00
Kris Wallsmith
fe62401907 optimized string starts with checks
Doing this with strpos() is slightly faster than substr().
2012-01-11 11:33:56 -08:00
Fabien Potencier
ca8dc87940 merged 2.0 2012-01-09 11:51:30 +01:00
Tobias Schultze
daee68a54e fixed typos and unified PHPDoc in the Response class 2012-01-05 23:17:04 +01:00
Fabien Potencier
6504d05804 fixed CS 2011-12-18 14:36:25 +01:00
Drak
a0e62f0775 Fix typos. 2011-11-03 11:22:03 +05:45
Drak
e6627fb0ff Docblocks. 2011-11-02 21:27:51 +05:45
Fabien Potencier
347053c363 Moved most of the logic from ResponseListener to the Response::prepare() method
That allows projects that only use HttpFoundation and not HttpKernel to be able to
enforce the HTTP specification "rules".

$request = Request::createFromGlobals();
$response = new Response();

// do whatever you want with the Respons

// enforce HTTP spec
$response->prepare($request);

$response->send();

Within Symfony2, the prepare method is automatically called by the ResponseListener.
2011-10-18 09:04:20 +02:00
lenar
805a2672d0 Remove Content-Length header adding for now. Fixes #1846. 2011-08-13 17:30:17 +03:00
Fabien Potencier
7dcbcbe69d [HttpFoundation] tagged public @api 2011-07-20 10:06:02 +02:00
Fabien Potencier
0e4d057984 moved some RFC-tweaking logic in Response to a public method to make it reusable 2011-07-11 11:22:12 +02:00
Fabien Potencier
1a576552f8 [HttpFoundation] fixed unit test for previous merge 2011-07-11 11:02:30 +02:00
Fabien Potencier
de2ab0b506 merged branch lenar/patch-3 (PR #1551)
Commits
-------

f7d0f65 RFC2616 changes
b9a218a [HttpFoundation] set Content-Length header to the length of content

Discussion
----------

[HttpFoundation] set Content-Length header to the length of content

I can't think of why this could be bad but if somebody knows please chime in.

The good thing is that with this change keepalive will work out of the box.

---------------------------------------------------------------------------

by Seldaek at 2011/07/06 05:34:51 -0700

That sounds like a great change. I think it might explain/fix the issues I've encountered with AppCache on my production box. Never had time to look into it, but IIRC I noticed the missing Content-Length, and it seemed to load forever.

---------------------------------------------------------------------------

by fabpot at 2011/07/06 06:46:50 -0700

The `Content-Length` is automatically added by servers like Apache. Moreover, sometimes, you should not add it: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4

---------------------------------------------------------------------------

by lenar at 2011/07/06 07:54:45 -0700

It is not added automatically by default. Yes, in case of Apache it is actually added if deflate module is enabled and if that module decides to compress the content (decision based on content-type).

About RFC2616: I will read it and add changes to this PR if applicable.

---------------------------------------------------------------------------

by fabpot at 2011/07/06 08:38:14 -0700

e943fde2ef

---------------------------------------------------------------------------

by Seldaek at 2011/07/06 08:45:22 -0700

@lenar all you have to do is skip setting the Content-Length for `1xx`, `204`, and `304` responses I believe.

---------------------------------------------------------------------------

by Seldaek at 2011/07/06 08:46:54 -0700

But this should maybe be done in sendHeaders() à la `fixContentType`, because you can't be sure about the statusCode before that.

---------------------------------------------------------------------------

by lenar at 2011/07/06 13:55:33 -0700

I propose this based on what I read and understood from RFC2616.

---------------------------------------------------------------------------

by mheleniak at 2011/07/10 03:57:26 -0700

+1
2011-07-11 10:58:31 +02:00
Fabien Potencier
bb5075d820 [HttpFoundation] prevented Response headers to be sent twice
This change allows for more flexibility if the developer wants to flush
the Response content early (the drawback being that Response listeners
won't be able to tweak the HTTP headers anymore).

There is another benefit: avoid the infamous
"Fatal error: Exception thrown without a stack frame in Unknown on line 0".

Here is a small scenario when this can happen (thanks dtee for identifying this issue):

* Call flush() in controller to output html early, then throw exception
* ExceptionHandler triggers handle() function and return new Response object to output...
* Because the header is sent (flush() call in Controller), php's E_WARNING error get raised, which gets handled by ErrorHandler->handle() and it throws new ErrorException()
* PHP fatals to prevent Exception loop: "Fatal error: Exception thrown without a stack frame in Unknown on line 0"
2011-07-07 07:34:35 +02:00
lenar
f7d0f651a3 RFC2616 changes 2011-07-06 23:50:37 +03:00
Lenar Lõhmus
b9a218a5c1 [HttpFoundation] set Content-Length header to the length of content 2011-07-06 23:47:40 +03:00
Fabien Potencier
84e87c65cc [HttpFoundation] fixed a bug in previous merge 2011-06-22 15:23:37 +02:00
Fabien Potencier
37521b6fd7 [HttpFoundation] forced Response content to be string 2011-06-22 15:22:06 +02:00
Jordi Boggiano
7af003b753 [HttpFoundation] Allow stringable objects and numbers in response body + added tests 2011-06-21 13:06:36 +02:00
Jordi Boggiano
8126fb7082 [HttpFoundation] Ensure response body is string, fixes #1378 2011-06-21 11:59:20 +02:00
Fabien Potencier
a12ea12fc1 fixed CS 2011-06-13 18:54:20 +02:00
Fabien Potencier
196350b892 Merge remote branch 'djama/patch-1'
* djama/patch-1:
  call header() with replace=false, to provide the possibility of sending mutiple headers of the same type.
2011-06-13 12:19:40 +02:00
Aurélien Fredouelle
6ae2bdeabd [HttpFoundation] Fixed indentation 2011-06-11 10:24:44 +02:00