Skip to content

Commit aecb289

Browse files
authored
Make Headers::get case insensitive
Because if a header is set like this: `Content-type: application/json` ``` Headers::get('Content-Type'); // null Headers::get('Content-type'); // 'application/json' ``` Causes problems in the `Request::get` method because it looks exactly for `Content-Type`.
1 parent 2809c6e commit aecb289

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Headers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static function all(bool $safeOutput = false): array
6464
*/
6565
public static function get($params, bool $safeOutput = false)
6666
{
67-
if (is_string($params)) return self::all($safeOutput)[$params] ?? null;
67+
if (is_string($params)) return array_change_key_case(self::all($safeOutput), CASE_LOWER)[strtolower($params)] ?? null;
6868

6969
$data = [];
7070
foreach ($params as $param) {

0 commit comments

Comments
 (0)