Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita99a480

Browse files
minor#33452 [HttpClient] Fix a bug preventing Server Pushes to be handled properly (dunglas)
This PR was merged into the 4.3 branch.Discussion----------[HttpClient] Fix a bug preventing Server Pushes to be handled properly| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | n/a| License | MIT| Doc PR | n/aFollows#33444.Commits-------e1fbaeb [HttpClient] Fix a bug preventing Server Pushes to be handled properly
2 parentsf48ebfa +e1fbaeb commita99a480

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/Symfony/Component/HttpClient/CurlHttpClient.php‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ public function request(string $method, string $url, array $options = []): Respo
106106
$url =implode('',$url);
107107

108108
if (!isset($options['normalized_headers']['user-agent'])) {
109-
$options['normalized_headers']['user-agent'][] ='Symfony HttpClient/Curl';
110-
$options['headers'][] ='User-Agent: Symfony HttpClient/Curl';
109+
$options['normalized_headers']['user-agent'][] =$options['headers'][] ='User-Agent: Symfony HttpClient/Curl';
111110
}
112111

113112
if ($pushedResponse =$this->multi->pushedResponses[$url] ??null) {
@@ -364,7 +363,12 @@ private static function acceptPushForRequest(string $method, array $options, Pus
364363
}
365364

366365
foreach (['authorization','cookie','range','proxy-authorization']as$k) {
367-
if (($pushedResponse->requestHeaders[$k] ??null) !== ($options['normalized_headers'][$k] ??null)) {
366+
$normalizedHeaders =$options['normalized_headers'][$k] ?? [];
367+
foreach ($normalizedHeadersas$i =>$v) {
368+
$normalizedHeaders[$i] =substr($v,\strlen($k) +2);
369+
}
370+
371+
if (($pushedResponse->requestHeaders[$k] ?? []) !==$normalizedHeaders) {
368372
returnfalse;
369373
}
370374
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp