diff --git a/src/SapiNormalizer.php b/src/SapiNormalizer.php index a709f4f..dcaeba6 100644 --- a/src/SapiNormalizer.php +++ b/src/SapiNormalizer.php @@ -90,7 +90,7 @@ public function normalizeHeaders(array $server): array $headers = []; foreach ($server as $name => $value) { - if (!is_string($name) || $value === '') { + if (!is_string($name)) { continue; } @@ -102,6 +102,7 @@ public function normalizeHeaders(array $server): array if (strpos($name, 'HTTP_') === 0) { $headers[$this->normalizeHeaderName(substr($name, 5))] = $value; + continue; } if (strpos($name, 'CONTENT_') === 0) { diff --git a/tests/SapiNormalizerTest.php b/tests/SapiNormalizerTest.php index 9786a40..ec72928 100644 --- a/tests/SapiNormalizerTest.php +++ b/tests/SapiNormalizerTest.php @@ -24,6 +24,7 @@ public function setUp(): void { $this->normalizer = new SapiNormalizer(); $this->server = [ + 'value-without-name', 'HTTPS' => 'on', 'SERVER_PORT' => '443', 'REQUEST_METHOD' => 'GET',