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
66
77 * Add stale while revalidate and stale if error cache header
88 * 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
109
11106.0
1211---
Original file line number Diff line number Diff line change @@ -371,10 +371,6 @@ public function sendContent(): static
371371 */
372372 public function send (): static
373373 {
374- if (\is_string ($ this ->content ) && '' !== $ this ->content && !$ this ->headers ->has ('Transfer-Encoding ' )) {
375- $ this ->headers ->set ('Content-Length ' , \strlen ($ this ->content ));
376- }
377-
378374 $ this ->sendHeaders ();
379375 $ this ->sendContent ();
380376
Original file line number Diff line number Diff line change @@ -57,20 +57,6 @@ public function testSend()
5757 $ this ->assertObjectHasAttribute ('statusCode ' , $ responseSent );
5858 $ this ->assertObjectHasAttribute ('statusText ' , $ responseSent );
5959 $ 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 ());
7460 }
7561
7662 public function testGetCharset ()
You can’t perform that action at this time.
0 commit comments