Skip to content

Commit 78e03c0

Browse files
Minor fixes
1 parent 5f20c26 commit 78e03c0

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/Symfony/Component/HttpClient/Internal/AmpBody.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @internal
2626
*/
27-
class AmpBody implements HttpContent, ReadableStream
27+
class AmpBody implements HttpContent, ReadableStream, \IteratorAggregate
2828
{
2929
private ReadableStream $body;
3030
private array $info;
@@ -121,6 +121,11 @@ public function onClose(\Closure $onClose): void
121121
$this->body->onClose($onClose);
122122
}
123123

124+
public function getIterator(): \Traversable
125+
{
126+
return $this->body;
127+
}
128+
124129
public static function rewind(HttpContent $body): HttpContent
125130
{
126131
if (!$body instanceof self) {

src/Symfony/Component/HttpClient/Internal/AmpClientState.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ public function request(array $options, Request $request, Cancellation $cancella
8080
}
8181
}
8282

83-
$request = clone $request;
84-
8583
if ($request->hasHeader('proxy-authorization')) {
8684
$request->removeHeader('proxy-authorization');
8785
}

src/Symfony/Component/HttpClient/Internal/AmpListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function startTlsNegotiation(Request $request): void
7171

7272
public function startSendingRequest(Request $request, Stream $stream): void
7373
{
74-
$host = $stream->getRemoteAddress()->getHost();
74+
$host = $stream->getRemoteAddress()->getAddress();
7575

7676
if (str_contains($host, ':')) {
7777
$host = '['.$host.']';

src/Symfony/Component/HttpClient/Response/AmpResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,5 +437,7 @@ private static function getPushedResponse(Request $request, AmpClientState $mult
437437

438438
return $response;
439439
}
440+
441+
return null;
440442
}
441443
}

0 commit comments

Comments
 (0)