Closed reformed closed 2 years ago
A header field name must be an RFC 7230 compatible string. Even if we cast the header field name to string, you'll still get InvalidArgumentException
unless you provide a valid HTTP header.
Regardless of valid or invalid HTTP headers, the PHP function strtolower
expects a string input. It is on you to ensure that only a string is passed to this function.
My PHP error log is showing an uncaught TypeError in Headers.php on line 184: https://github.com/slimphp/Slim-Psr7/blob/1726c664ac200c663799f8339f810ad0cde28803/src/Headers.php#L181
The
$headers
array is assumed to have all string keys. This can likely be fixed by simply casting$name
on line 184 as string.