Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed method of detecting empty strings
  • Loading branch information
oauth2-middleware committed Dec 31, 2018
1 parent 9e4176a commit 0f81d60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions/marshal_headers_from_sapi.php
Expand Up @@ -35,13 +35,13 @@ function marshalHeadersFromSapi(array $server) : array
}
}

if (($value || $value === "0") && strpos($key, 'HTTP_') === 0) {
if ($value != '' && strpos($key, 'HTTP_') === 0) {
$name = strtr(strtolower(substr($key, 5)), '_', '-');
$headers[$name] = $value;
continue;
}

if ($value && strpos($key, 'CONTENT_') === 0) {
if ($value != '' && strpos($key, 'CONTENT_') === 0) {
$name = 'content-' . strtolower(substr($key, 8));
$headers[$name] = $value;
continue;
Expand Down

0 comments on commit 0f81d60

Please sign in to comment.