@@ -57,16 +57,14 @@ private function parseParams(String $query = null)
57
57
parse_str ($ query , $ this ->params );
58
58
}
59
59
60
- private function parseHeaders (array $ headers = null , bool $ parse = false )
60
+ private function parseHeaders (array $ headers = null )
61
61
{
62
62
if (!$ headers ) {
63
63
$ 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 ;
70
68
}
71
69
}
72
70
}
@@ -136,11 +134,6 @@ public function getHeader(String $key): String
136
134
{
137
135
if (isset ($ this ->headers [$ key ])) {
138
136
return $ this ->headers [$ key ];
139
- } else {
140
- $ serverKey = 'HTTP_ ' . strtoupper (str_replace ('_ ' , '- ' , $ key ));
141
- if (isset ($ _SERVER [$ serverKey ])) {
142
- return $ _SERVER [$ serverKey ];
143
- }
144
137
}
145
138
return '' ;
146
139
}
0 commit comments