Skip to content

Commit 6552246

Browse files
committed
Fix SapiNormalizer::normalizeHeaders() method
1 parent 22c70c7 commit 6552246

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/SapiNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function normalizeHeaders(array $server): array
9090
$headers = [];
9191

9292
foreach ($server as $name => $value) {
93-
if (!is_string($name) || $value === '') {
93+
if (!is_string($name)) {
9494
continue;
9595
}
9696

@@ -102,6 +102,7 @@ public function normalizeHeaders(array $server): array
102102

103103
if (strpos($name, 'HTTP_') === 0) {
104104
$headers[$this->normalizeHeaderName(substr($name, 5))] = $value;
105+
continue;
105106
}
106107

107108
if (strpos($name, 'CONTENT_') === 0) {

tests/SapiNormalizerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function setUp(): void
2424
{
2525
$this->normalizer = new SapiNormalizer();
2626
$this->server = [
27+
'value-without-name',
2728
'HTTPS' => 'on',
2829
'SERVER_PORT' => '443',
2930
'REQUEST_METHOD' => 'GET',

0 commit comments

Comments
 (0)