Restrict disable Feature Negotiation
This commit is contained in:
@ -81,6 +81,8 @@ final class ClientConfig implements JsonSerializable
|
|||||||
// A string identifying the agent for this client in the spirit of HTTP.
|
// A string identifying the agent for this client in the spirit of HTTP.
|
||||||
public string $userAgent = '',
|
public string $userAgent = '',
|
||||||
) {
|
) {
|
||||||
|
$this->featureNegotiation = true; // Always enabled
|
||||||
|
|
||||||
if ('' === $this->hostname) {
|
if ('' === $this->hostname) {
|
||||||
$this->hostname = (static fn (mixed $h): string => \is_string($h) ? $h : '')(gethostname());
|
$this->hostname = (static fn (mixed $h): string => \is_string($h) ? $h : '')(gethostname());
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,8 @@ use const PHP_EOL;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
*
|
||||||
|
* @property ConnectionConfig $connectionConfig
|
||||||
*/
|
*/
|
||||||
abstract class Connection
|
abstract class Connection
|
||||||
{
|
{
|
||||||
@ -77,9 +79,7 @@ abstract class Connection
|
|||||||
|
|
||||||
$response = $this->command('IDENTIFY', data: $body)->response();
|
$response = $this->command('IDENTIFY', data: $body)->response();
|
||||||
|
|
||||||
if ($this->clientConfig->featureNegotiation) {
|
|
||||||
$this->connectionConfig = ConnectionConfig::fromArray($response->toArray());
|
$this->connectionConfig = ConnectionConfig::fromArray($response->toArray());
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->connectionConfig->snappy || $this->connectionConfig->deflate) {
|
if ($this->connectionConfig->snappy || $this->connectionConfig->deflate) {
|
||||||
$this->response()->okOrFail();
|
$this->response()->okOrFail();
|
||||||
|
Reference in New Issue
Block a user