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

Commit

Permalink
Small simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Mar 12, 2016
1 parent dcad567 commit 0c2ab02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ServerRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,18 @@ public static function marshalHeaders(array $server)
$headers = [];
foreach ($server as $key => $value) {
if ($value && strpos($key, 'HTTP_') === 0) {
$name = strtr(substr($key, 5), '_', ' ');
$name = strtr(ucwords(strtolower($name)), ' ', '-');
$name = substr($key, 5);
$name = strtr($name, '_', '-');
$name = strtolower($name);

$headers[$name] = $value;
continue;
}

if ($value && strpos($key, 'CONTENT_') === 0) {
$name = substr($key, 8); // Content-
$name = 'Content-' . (($name == 'MD5') ? $name : ucfirst(strtolower($name)));
$name = strtr($key, '_', '-');
$name = strtolower($name);

$headers[$name] = $value;
continue;
}
Expand Down

0 comments on commit 0c2ab02

Please sign in to comment.