8000 Merge branch '5.4' into 6.4 · symfony/symfony@f2d7ff6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2d7ff6

Browse files
Merge branch '5.4' into 6.4
* 5.4: [HttpClient] Fix streaming and redirecting with NoPrivateNetworkHttpClient Bump Symfony version to 5.4.49 Update VERSION for 5.4.48 Update CONTRIBUTORS for 5.4.48 Update CHANGELOG for 5.4.48
2 parents 2982bb7 + 7a2d66a commit f2d7ff6

9 files changed

+112
-60
lines changed

CONTRIBUTORS.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The Symfony Connect username in parenthesis allows to get more information
1919
- Jordi Boggiano (seldaek)
2020
- Maxime Steinhausser (ogizanagi)
2121
- Kévin Dunglas (dunglas)
22-
- Victor Berchet (victor)
2322
- Javier Eguiluz (javier.eguiluz)
23+
- Victor Berchet (victor)
2424
- Ryan Weaver (weaverryan)
2525
- Jérémy DERUSSÉ (jderusse)
2626
- Jules Pietri (heah)
@@ -51,15 +51,15 @@ The Symfony Connect username in parenthesis allows to get more information
5151
- Igor Wiedler
5252
- Jan Schädlich (jschaedl)
5353
- Mathieu Lechat (mat_the_cat)
54+
- Simon André (simonandre)
5455
- Matthias Pigulla (mpdude)
5556
- Gabriel Ostrolucký (gadelat)
56-
- Simon André (simonandre)
5757
- Jonathan Wage (jwage)
58+
- Mathias Arlaud (mtarld)
5859
- Vincent Langlet (deviling)
5960
- Valentin Udaltsov (vudaltsov)
60-
- Mathias Arlaud (mtarld)
61-
- Alexandre Salomé (alexandresalome)
6261
- Grégoire Paris (greg0ire)
62+
- Alexandre Salomé (alexandresalome)
6363
- William DURAND
6464
- ornicar
6565
- Dany Maillard (maidmaid)
@@ -83,11 +83,11 @@ The Symfony Connect username in parenthesis allows to get more information
8383
- Alexander Schranz (alexander-schranz)
8484
- Mathieu Piot (mpiot)
8585
- Vasilij Duško (staff)
86+
- Dariusz Ruminski
8687
- Sarah Khalil (saro0h)
8788
- Laurent VOULLEMIER (lvo)
8889
- Konstantin Kudryashov (everzet)
8990
- Guilhem N (guilhemn)
90-
- Dariusz Ruminski
9191
- Bilal Amarni (bamarni)
9292
- Eriksen Costa
9393
- Florin Patan (florinpatan)
@@ -110,12 +110,12 @@ The Symfony Connect username in parenthesis allows to get more information
110110
- Baldini
111111
- Alex Pott
112112
- Fran Moreno (franmomu)
113+
- Hubert Lenoir (hubert_lenoir)
113114
- Charles Sarrazin (csarrazi)
114115
- Henrik Westphal (snc)
115116
- Dariusz Górecki (canni)
116-
- Hubert Lenoir (hubert_lenoir)
117-
- Ener-Getick
118117
- Antoine Makdessi (amakdessi)
118+
- Ener-Getick
119119
- Graham Campbell (graham)
120120
- Tugdual Saunier (tucksaun)
121121
- Lee McDermott
@@ -148,6 +148,7 @@ The Symfony Connect username in parenthesis allows to get more information
148148
- Jérôme Vasseur (jvasseur)
149149
- Peter Kokot (peterkokot)
150150
- Brice BERNARD (brikou)
151+
- Valtteri R (valtzu)
151152
- Martin Auswöger
152153
- Michal Piotrowski
153154
- marc.weistroff
@@ -156,7 +157,6 @@ The Symfony Connect username in parenthesis allows to get more information
156157
- Vladimir Tsykun (vtsykun)
157158
- Jacob Dreesen (jdreesen)
158159
- Włodzimierz Gajda (gajdaw)
159-
- Valtteri R (valtzu)
160160
- Nicolas Philippe (nikophil)
161161
- Javier Spagnoletti (phansys)
162162
- Adrien Brault (adrienbrault)
@@ -170,6 +170,7 @@ The Symfony Connect username in parenthesis allows to get more information
170170
- Baptiste Clavié (talus)
171171
- Alexander Schwenn (xelaris)
172172
- Fabien Pennequin (fabienpennequin)
173+
- Dāvis Zālītis (k0d3r1s)
173174
- Gordon Franke (gimler)
174175
- Malte Schlüter (maltemaltesich)
175176
- jeremyFreeAgent (jeremyfreeagent)
@@ -178,7 +179,6 @@ The Symfony Connect username in parenthesis allows to get more information
178179
- Vasilij Dusko
179180
- Daniel Wehner (dawehner)
180181
- Maxime Helias (maxhelias)
181-
- Dāvis Zālītis (k0d3r1s)
182182
- Robert Schönthal (digitalkaoz)
183183
- Smaine Milianni (ismail1432)
184184
- François-Xavier de Guillebon (de-gui_f)
@@ -193,6 +193,7 @@ The Symfony Connect username in parenthesis allows to get more information
193193
- Jhonny Lidfors (jhonne)
194194
- Juti Noppornpitak (shiroyuki)
195195
- Gregor Harlan (gharlan)
196+
- Alexis Lefebvre
196197
- Hugo Alliaume (kocal)
197198
- Anthony MARTIN
198199
- Sebastian Hörl (blogsh)
@@ -206,7 +207,6 @@ The Symfony Connect username in parenthesis allows to get more information
206207
- Guilherme Blanco (guilhermeblanco)
207208
- Saif Eddin Gmati (azjezz)
208209
- Farhad Safarov (safarov)
209-
- Alexis Lefebvre
210210
- SpacePossum
211211
- Richard van Laak (rvanlaak)
212212
- Andreas Braun
@@ -351,6 +351,7 @@ The Symfony Connect username in parenthesis allows to get more information
351351
- fd6130 (fdtvui)
352352
- Priyadi Iman Nurcahyo (priyadi)
353353
- Alan Poulain (alanpoulain)
354+
- Oleg Andreyev (oleg.andreyev)
354355
- Maciej Malarz (malarzm)
355356
- Marcin Sikoń (marphi)
356357
- Michele Orselli (orso)
@@ -390,13 +391,13 @@ The Symfony Connect username in parenthesis allows to get more information
390391
- Alexander Kotynia (olden)
391392
- Elnur Abdurrakhimov (elnur)
392393
- Manuel Reinhard (sprain)
394+
- Zan Baldwin (zanbaldwin)
393395
- Antonio J. García Lagar (ajgarlag)
394396
- BoShurik
395397
- Quentin Devos
396398
- Adam Prager (padam87)
397399
- Benoît Burnichon (bburnichon)
398400
- maxime.steinhausser
399-
- Oleg Andreyev (oleg.andreyev)
400401
- Roman Ring (inori)
401402
- Xavier Montaña Carreras (xmontana)
402403
- Arjen van der Meijden
@@ -460,7 +461,6 @@ The Symfony Connect username in parenthesis allows to get more information
460461
- Magnus Nordlander (magnusnordlander)
461462
- Tim Goudriaan (codedmonkey)
462463
- Robert Kiss (kepten)
463-
- Zan Baldwin (zanbaldwin)
464464
- Alexandre Quercia (alquerci)
465465
- Marcos Sánchez
466466
- Emanuele Panzeri (thepanz)
@@ -484,6 +484,7 @@ The Symfony Connect username in parenthesis allows to get more information
484484
- Bohan Yang (brentybh)
485485
- Vilius Grigaliūnas
486486
- David Badura (davidbadura)
487+
- Jordane VASPARD (elementaire)
487488
- Chris Smith (cs278)
488489
- Thomas Bisignani (toma)
489490
- Florian Klein (docteurklein)
@@ -582,7 +583,6 @@ The Symfony Connect username in parenthesis allows to get more information
582583
- Alexander Menshchikov
583584
- Clément Gauti 10000 er (clementgautier)
584585
- roman joly (eltharin)
585-
- Jordane VASPARD (elementaire)
586586
- James Gilliland (neclimdul)
587587
- Sanpi (sanpi)
588588
- Eduardo Gulias (egulias)
@@ -683,6 +683,7 @@ The Symfony Connect username in parenthesis allows to get more information
683683
- Neil Peyssard (nepey)
684684
- Niklas Fiekas
685685
- Mark Challoner (markchalloner)
686+
- Andreas Hennings
686687
- Markus Bachmann (baachi)
687688
- Gunnstein Lye (glye)
688689
- Erkhembayar Gantulga (erheme318)
@@ -797,6 +798,7 @@ The Symfony Connect username in parenthesis allows to get more information
797798
- Kev
798799
- Kevin McBride
799800
- Sergio Santoro
801+
- Jonas Elfering
800802
- Philipp Rieber (bicpi)
801803
- Dmitriy Derepko
802804
- Manuel de Ruiter (manuel)
@@ -949,7 +951,6 @@ The Symfony Connect username in parenthesis allows to get more information
949951
- Franck RANAIVO-HARISOA (franckranaivo)
950952
- Yi-Jyun Pan
951953
- Egor Taranov
952-
- Andreas Hennings
953954
- Arnaud Frézet
954955
- Philippe Segatori
955956
- Jon Gotlin (jongotlin)
@@ -1295,6 +1296,7 @@ The Symfony Connect username in parenthesis allows to get more information
12951296
- _sir_kane (waly)
12961297
- Olivier Maisonneuve
12971298
- Gálik Pál
1299+
- Bálint Szekeres
12981300
- Andrei C. (moldman)
12991301
- Mike Meier (mykon)
13001302
- Pedro Miguel Maymone de Resende (pedroresende)
@@ -1306,6 +1308,7 @@ The Symfony Connect username in parenthesis allows to get more information
13061308
- Kagan Balga (kagan-balga)
13071309
- Nikita Nefedov (nikita2206)
13081310
- Alex Bacart
1311+
- StefanoTarditi
13091312
- cgonzalez
13101313
- hugovms
13111314
- Ben
@@ -1418,6 +1421,7 @@ The Symfony Connect username in parenthesis allows to get more information
14181421
- Jason Woods
14191422
- mwsaz
14201423
- bogdan
1424+
- wanxiangchwng
14211425
- Geert De Deckere
14221426
- grizlik
14231427
- Derek ROTH
@@ -1447,7 +1451,6 @@ The Symfony Connect username in parenthesis allows to get more information
14471451
- Morten Wulff (wulff)
14481452
- Kieran
14491453
- Don Pinkster
1450-
- Jonas Elfering
14511454
- Maksim Muruev
14521455
- Emil Einarsson
14531456
- 243083df
@@ -1624,6 +1627,7 @@ The Symfony Connect username in parenthesis allows to get more information
16241627
- Luciano Mammino (loige)
16251628
- LHommet Nicolas (nicolaslh)
16261629
- fabios
1630+
- eRIZ
16271631
- Sander Coolen (scoolen)
16281632
- Vic D'Elfant (vicdelfant)
16291633
- Amirreza Shafaat (amirrezashafaat)
@@ -2034,6 +2038,7 @@ The Symfony Connect username in parenthesis allows to get more information
20342038
- Vladimir Mantulo (mantulo)
20352039
- Boullé William (williamboulle)
20362040
- Jesper Noordsij
2041+
- Bart Baaten
20372042
- Frederic Godfrin
20382043
- Paul Matthews
20392044
- aim8604
@@ -2068,6 +2073,7 @@ The Symfony Connect username in parenthesis allows to get more information
20682073
- Dalibor Karlović
20692074
- Cesar Scur (cesarscur)
20702075
- Cyril Vermandé (cyve)
2076+
- Daniele Orru' (danydev)
20712077
- Raul Garcia Canet (juagarc4)
20722078
- Sagrario Meneses
20732079
- Dmitri Petmanson
@@ -2161,6 +2167,7 @@ The Symfony Connect username in parenthesis allows to get more information
21612167
- Maxime THIRY
21622168
- Norman Soetbeer
21632169
- Ludek Stepan
2170+
- Benjamin BOUDIER
21642171
- Frederik Schwan
21652172
- Mark van den Berg
21662173
- Aaron Stephens (astephens)
@@ -2276,6 +2283,7 @@ The Symfony Connect username in parenthesis allows to get more information
22762283
- Frank Neff (fneff)
22772284
- Volodymyr Kupriienko (greeflas)
22782285
- Ilya Biryukov (ibiryukov)
2286+
- Mathieu Ledru (matyo91)
22792287
- Roma (memphys)
22802288
- Florian Caron (shalalalala)
22812289
- Serhiy Lunak (slunak)
@@ -2381,7 +2389,6 @@ The Symfony Connect username in parenthesis allows to get more information
23812389
- Nicolas Eeckeloo (neeckeloo)
23822390
- Andriy Prokopenko (sleepyboy)
23832391
- Dariusz Ruminski
2384-
- Bálint Szekeres
23852392
- Starfox64
23862393
- Ivo Valchev
23872394
- Thomas Hanke
@@ -2472,6 +2479,7 @@ The Symfony Connect username in parenthesis allows to get more information
24722479
- karstennilsen
24732480 10000
- kaywalker
24742481
- Sebastian Ionescu
2482+
- Kurt Thiemann
24752483
- Robert Kopera
24762484
- Pablo Ogando Ferreira
24772485
- Thomas Ploch
@@ -2481,6 +2489,7 @@ The Symfony Connect username in parenthesis allows to get more information
24812489
- Jeremiah VALERIE
24822490
- Alexandre Beaujour
24832491
- Franck Ranaivo-Harisoa
2492+
- Grégoire Rabasse
24842493
- Cas van Dongen
24852494
- Patrik Patie Gmitter
24862495
- George Yiannoulopoulos
@@ -2560,6 +2569,7 @@ The Symfony Connect username in parenthesis allows to get more information
25602569
- Tobias Genberg (lorceroth)
25612570
- Michael Simonson (mikes)
25622571
- Nicolas Badey (nico-b)
2572+
- Florent Blaison (orkin)
25632573
- Olivier Scherler (oscherler)
25642574
- Flo Gleixner (redflo)
25652575
- Romain Jacquart (romainjacquart)
@@ -3158,6 +3168,7 @@ The Symfony Connect username in parenthesis allows to get more information
31583168
- Vlad Dumitrache
31593169
- wetternest
31603170
- Erik van Wingerden
3171+
- matlec
31613172
- Valouleloup
31623173
- Pathpat
31633174
- Jaymin G
@@ -3302,6 +3313,7 @@ The Symfony Connect username in parenthesis allows to get more information
33023313
- dasmfm
33033314
- Claas Augner
33043315
- Mathias Geat
3316+
- neodevcode
33053317
- Angel Fernando Quiroz Campos (angelfqc)
33063318
- Arnaud Buathier (arnapou)
33073319
- Curtis (ccorliss)
@@ -3362,6 +3374,7 @@ The Symfony Connect username in parenthesis allows to get more information
33623374
- Steffen Keuper
33633375
- Kai Eichinger
33643376
- Antonio Angelino
3377+
- Jan Nedbal
33653378
- Jens Schulze
33663379
- Tema Yud
33673380
- Matt Fields
@@ -3393,6 +3406,7 @@ The Symfony Connect username in parenthesis allows to get more information
33933406
- Menno Holtkamp
33943407
- Ser5
33953408
- Michael Hudson-Doyle
3409+
- Matthew Burns
33963410
- Daniel Bannert
33973411
- Karim Miladi
33983412
- Michael Genereux
@@ -3771,6 +3785,7 @@ The Symfony Connect username in parenthesis allows to get more information
37713785
- damaya
37723786
- Kevin Weber
37733787
- Alexandru Năstase
3788+
- Carl Julian Sauter
37743789
- Dionysis Arvanitis
37753790
- Sergey Fedotov
37763791
- Konstantin Scheumann

src/Symfony/Component/HttpClient/NoPrivateNetworkHttpClient.php

Lines changed: 14 additions & 18 deletions
+
if (isset($options['normalized_headers']['host']) || isset($options['normalized_headers']['authorization']) || isset($options['normalized_headers']['cookie'])) {
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Contracts\HttpClient\ChunkInterface;
2121
use Symfony\Contracts\HttpClient\HttpClientInterface;
2222
use Symfony\Contracts\HttpClient\ResponseInterface;
23-
use Symfony\Contracts\HttpClient\ResponseStreamInterface;
2423
use Symfony\Contracts\Service\ResetInterface;
2524

2625
/**
@@ -81,32 +80,34 @@ public function request(string $method, string $url, array $options = []): Respo
8180
$ip = self::dnsResolve($dnsCache, $host, $this->ipFlags, $options);
8281
self::ipCheck($ip, $this->subnets, $this->ipFlags, $host, $url);
8382

84-
if (0 < $maxRedirects = $options['max_redirects']) {
85-
$options['max_redirects'] = 0;
86-
$redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = $options['headers'];
87-
88-
if (isset($options['normalized_headers']['host']) || isset($options['normalized_headers']['authorization']) || isset($options['normalized_headers']['cookie'])) {
89-
$redirectHeaders['no_auth'] = array_filter($redirectHeaders['no_auth'], static function ($h) {
90-
return 0 !== stripos($h, 'Host:') && 0 !== stripos($h, 'Authorization:') && 0 !== stripos($h, 'Cookie:');
91-
});
92-
}
93-
}
94-
9583
$onProgress = $options['on_progress'] ?? null;
9684
$subnets = $this->subnets;
9785
$ipFlags = $this->ipFlags;
9886

9987
$options['on_progress'] = static function (int $dlNow, int $dlSize, array $info) use ($onProgress, $subnets, $ipFlags): void {
10088
static $lastPrimaryIp = '';
10189

102-
if (($info['primary_ip'] ?? '') !== $lastPrimaryIp) {
90+
if (!\in_array($info['primary_ip'] ?? '', ['', $lastPrimaryIp], true)) {
10391
self::ipCheck($info['primary_ip'], $subnets, $ipFlags, null, $info['url']);
10492
$lastPrimaryIp = $info['primary_ip'];
10593
}
10694

10795
null !== $onProgress && $onProgress($dlNow, $dlSize, $info);
10896
};
10997

98+
if (0 >= $maxRedirects = $options['max_redirects']) {
99+
return new AsyncResponse($this->client, $method, $url, $options);
100+
}
101+
102+
$options['max_redirects'] = 0;
103+
$redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = $options['headers'];
104+
105
106+
$redirectHeaders['no_auth'] = array_filter($redirectHeaders['no_auth'], static function ($h) {
107+
return 0 !== stripos($h, 'Host:') && 0 !== stripos($h, 'Authorization:') && 0 !== stripos($h, 'Cookie:');
108+
});
109+
}
110+
110111
return new AsyncResponse($this->client, $method, $url, $options, static function (ChunkInterface $chunk, AsyncContext $context) use (&$method, &$options, $maxRedirects, &$redirectHeaders, $subnets, $ipFlags, $dnsCache): \Generator {
111112
if (null !== $chunk->getError() || $chunk->isTimeout() || !$chunk->isFirst()) {
112113
yield $chunk;
@@ -158,11 +159,6 @@ public function request(string $method, string $url, array $options = []): Respo
158159
});
159160
}
160161

161-
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
162-
{
163-
return $this->client->stream($responses, $timeout);
164-
}
165-
166162
public function setLogger(LoggerInterface $logger): void
167163
{
168164
if ($this->client instanceof LoggerAwareInterface) {

src/Symfony/Component/HttpClient/Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ public static function setUpBeforeClass(): void
2424
TestHttpServer::start();
2525
}
2626

27-
public static function tearDownAfterClass(): void
28-
{
29-
TestHttpServer::stop();
30-
}
31-
3227
public function testItCollectsRequestCount()
3328
{
3429
$httpClient1 = $this->httpClientThatHasTracedRequests([

0 commit comments

Comments
 (0)
0