-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Updating the package to version 22.2.0 broke everything for me due to an invalid typing in this snippet.
ERROR php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Uncaught TypeError: OpenSwoole\Core\Psr\Message::getHeader(): Return value must be of type array, string returned in /var/www/vendor/openswoole/core/src/Psr/Message.php:111
public function getHeader(string $name): array
{
return $this->hasHeader($name) ? $this->headers[strtolower($name)] : [];
}
It's not always an array, in my case it's simply the retrieval of the "Authorization" header
Bearer xxxxxxxxxx.xxxxxxxxxx.xxxxxxx
I remedied the situation like this:
public function getHeader(string $name): array|string
{
return $this->hasHeader($name) ? $this->headers[strtolower($name)] : [];
}
What do you think? Have you encountered this problem?
Metadata
Metadata
Assignees
Labels
No labels