File tree Expand file tree Collapse file tree 3 files changed +0
-19
lines changed Expand file tree Collapse file tree 3 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ CHANGELOG
6
6
7
7
* Add stale while revalidate and stale if error cache header
8
8
* Allow dynamic session "ttl" when using a remote storage
9
- * Send ` Content-Length ` when calling ` Response::send() ` and the content is a non-empty string
10
9
11
10
6.0
12
11
---
Original file line number Diff line number Diff line change @@ -371,10 +371,6 @@ public function sendContent(): static
371
371
*/
372
372
public function send (): static
373
373
{
374
- if (\is_string ($ this ->content ) && '' !== $ this ->content && !$ this ->headers ->has ('Transfer-Encoding ' )) {
375
- $ this ->headers ->set ('Content-Length ' , \strlen ($ this ->content ));
376
- }
377
-
378
374
$ this ->sendHeaders ();
379
375
$ this ->sendContent ();
380
376
Original file line number Diff line number Diff line change @@ -57,20 +57,6 @@ public function testSend()
57
57
$ this ->assertObjectHasAttribute ('statusCode ' , $ responseSent );
58
58
$ this ->assertObjectHasAttribute ('statusText ' , $ responseSent );
59
59
$ this ->assertObjectHasAttribute ('charset ' , $ responseSent );
60
- $ this ->assertFalse ($ responseSent ->headers ->has ('Content-Length ' ));
61
-
62
- ob_start ();
63
-
64
- $ response = new Response ('foo ' );
65
- $ responseSent = $ response ->send ();
66
- $ this ->assertSame ('3 ' , $ responseSent ->headers ->get ('Content-Length ' ));
67
-
68
- $ response = new Response ('bar ' );
69
- $ response ->headers ->set ('Transfer-Encoding ' , 'chunked ' );
70
- $ responseSent = $ response ->send ();
71
- $ this ->assertFalse ($ responseSent ->headers ->has ('Content-Length ' ));
72
-
73
- $ this ->assertSame ('foobar ' , ob_get_clean ());
74
60
}
75
61
76
62
public function testGetCharset ()
You can’t perform that action at this time.
0 commit comments