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

Appearance settings

Commit e1fbaeb

Browse filesBrowse files
committed
[HttpClient] Fix a bug preventing Server Pushes to be handled properly
1 parent f48ebfa commit e1fbaeb
Copy full SHA for e1fbaeb

File tree

1 file changed

+7
-3
lines changed
Filter options

1 file changed

+7
-3
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/CurlHttpClient.php
+7-3Lines 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 ($normalizedHeaders as $i => $v) {
368+
$normalizedHeaders[$i] = substr($v, \strlen($k) + 2);
369+
}
370+
371+
if (($pushedResponse->requestHeaders[$k] ?? []) !== $normalizedHeaders) {
368372
return false;
369373
}
370374
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.