Skip to content

Commit dc58f94

Browse files
Merge branch '6.4' into 7.2
* 6.4: switch to Composer 2 metadata Fix `ContainerDebugCommandTest::testNoDumpedXML` doc: update UserInterface header comments Fix: Lack of recipient in case DSN does not have optional LIST_ID parameter. [PhpUnitBridge] Mark as dev package [DependencyInjection] Make `YamlDumper` quote resolved env vars if necessary Bump Symfony version to 6.4.23 Update VERSION for 6.4.22 Update CONTRIBUTORS for 6.4.22 Update CHANGELOG for 6.4.22 fixed Via regex
2 parents 0c15d5e + 452d19f commit dc58f94

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ public function isMethodCacheable(): bool
13841384
public function getProtocolVersion(): ?string
13851385
{
13861386
if ($this->isFromTrustedProxy()) {
1387-
preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via') ?? '', $matches);
1387+
preg_match('~^(HTTP/)?([1-9]\.[0-9])\b~', $this->headers->get('Via') ?? '', $matches);
13881388

13891389
if ($matches) {
13901390
return 'HTTP/'.$matches[2];

Tests/RequestTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,6 +2417,8 @@ public static function protocolVersionProvider()
24172417
'trusted with via and protocol name' => ['HTTP/2.0', true, 'HTTP/1.0 fred, HTTP/1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'],
24182418
'trusted with broken via' => ['HTTP/2.0', true, 'HTTP/1^0 foo', 'HTTP/2.0'],
24192419
'trusted with partially-broken via' => ['HTTP/2.0', true, '1.0 fred, foo', 'HTTP/1.0'],
2420+
'trusted with simple via' => ['HTTP/2.0', true, 'HTTP/1.0', 'HTTP/1.0'],
2421+
'trusted with only version via' => ['HTTP/2.0', true, '1.0', 'HTTP/1.0'],
24202422
];
24212423
}
24222424

0 commit comments

Comments
 (0)