Skip to content

Commit 8a4a0f3

Browse files
Merge branch '4.3' into 4.4
* 4.3: [Config] Disable default alphabet sorting in glob function due of unstable sort [HttpClient] always return the empty string when the response cannot have a body [TwigBundle][exception] Added missing css variable to highlight line in trace [Serializer] Improve messages for unexpected resources values [SecurityBundle] correct types for default arguments for firewall configs
2 parents 3a3e2a6 + 4dbd08b commit 8a4a0f3

File tree

2 files changed

+7
-33
lines changed

2 files changed

+7
-33
lines changed

Response/ResponseTrait.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,15 @@ public function getContent(bool $throw = true): string
117117
}
118118
}
119119

120-
if (null === $content) {
121-
throw new TransportException('Cannot get the content of the response twice: buffering is disabled.');
120+
if (null !== $content) {
121+
return $content;
122122
}
123123

124-
return $content;
124+
if ('HEAD' === $this->info['http_method'] || \in_array($this->info['http_code'], [204, 304], true)) {
125+
return '';
126+
}
127+
128+
throw new TransportException('Cannot get the content of the response twice: buffering is disabled.');
125129
}
126130

127131
foreach (self::stream([$this]) as $chunk) {

Tests/HttpClientTestCase.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,4 @@ public function testToStream404()
7575
$response = $client->request('GET', 'http://localhost:8057/404');
7676
$stream = $response->toStream();
7777
}
78-
79-
public function testInfoOnCanceledResponse()
80-
{
81-
$this->markTestSkipped('Implemented as of version 4.4');
82-
}
83-
84-
public function testBufferSink()
85-
{
86-
$this->markTestSkipped('Implemented as of version 4.4');
87-
}
88-
89-
public function testConditionalBuffering()
90-
{
91-
$this->markTestSkipped('Implemented as of version 4.4');
92-
}
93-
94-
public function testReentrantBufferCallback()
95-
{
96-
$this->markTestSkipped('Implemented as of version 4.4');
97-
}
98-
99-
public function testThrowingBufferCallback()
100-
{
101-
$this->markTestSkipped('Implemented as of version 4.4');
102-
}
103-
104-
public function testMaxDuration()
105-
{
106-
$this->markTestSkipped('Implemented as of version 4.4');
107-
}
10878
}

0 commit comments

Comments
 (0)