Skip to content

Commit 36d7d76

Browse files
committed
Revert performance improvement
1 parent f09e3a1 commit 36d7d76

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/Tqdev/PhpCrudApi/Request.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,14 @@ private function parseParams(String $query = null)
5757
parse_str($query, $this->params);
5858
}
5959

60-
private function parseHeaders(array $headers = null, bool $parse = false)
60+
private function parseHeaders(array $headers = null)
6161
{
6262
if (!$headers) {
6363
$headers = array();
64-
if ($parse) {
65-
foreach ($_SERVER as $name => $value) {
66-
if (substr($name, 0, 5) == 'HTTP_') {
67-
$key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
68-
$headers[$key] = $value;
69-
}
64+
foreach ($_SERVER as $name => $value) {
65+
if (substr($name, 0, 5) == 'HTTP_') {
66+
$key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
67+
$headers[$key] = $value;
7068
}
7169
}
7270
}
@@ -136,11 +134,6 @@ public function getHeader(String $key): String
136134
{
137135
if (isset($this->headers[$key])) {
138136
return $this->headers[$key];
139-
} else {
140-
$serverKey = 'HTTP_' . strtoupper(str_replace('_', '-', $key));
141-
if (isset($_SERVER[$serverKey])) {
142-
return $_SERVER[$serverKey];
143-
}
144137
}
145138
return '';
146139
}

0 commit comments

Comments
 (0)