File tree 1 file changed +7
-3
lines changed
Filter options
src/Symfony/Component/HttpClient
1 file changed +7
-3
lines changed
Original file line number Diff line number Diff line change @@ -106,8 +106,7 @@ public function request(string $method, string $url, array $options = []): Respo
106
106
$ url = implode ('' , $ url );
107
107
108
108
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 ' ;
111
110
}
112
111
113
112
if ($ pushedResponse = $ this ->multi ->pushedResponses [$ url ] ?? null ) {
@@ -364,7 +363,12 @@ private static function acceptPushForRequest(string $method, array $options, Pus
364
363
}
365
364
366
365
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 ) {
368
372
return false ;
369
373
}
370
374
}
You can’t perform that action at this time.
0 commit comments