Skip to content

Commit 39e0477

Browse files
Update ProtocolFactory.php
1 parent 47d972e commit 39e0477

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/Bolt/ProtocolFactory.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,11 @@ class ProtocolFactory
3333
public function createProtocol(IConnection $connection, AuthenticateInterface $auth, string $userAgent): array
3434
{
3535
$bolt = new Bolt($connection);
36-
$bolt->setProtocolVersions(5.4, 5.3, 5, 4.4);
37-
38-
try {
39-
$protocol = $bolt->build();
40-
} catch (ConnectException $e) {
41-
// Assume incorrect protocol version
42-
$bolt->setProtocolVersions(5.2, 5.1);
43-
$protocol = $bolt->build();
44-
}
36+
$bolt->setProtocolVersions('5.4.4', 4.4);
37+
$protocol = $bolt->build();
4538

4639
if (!($protocol instanceof V4_4 || $protocol instanceof V5 || $protocol instanceof V5_1 || $protocol instanceof V5_2 || $protocol instanceof V5_3 || $protocol instanceof V5_4)) {
47-
throw new RuntimeException('Client only supports bolt version 4.4 and ^5.0');
40+
throw new RuntimeException('Client only supports bolt version 4.4 to 5.4');
4841
}
4942

5043
$response = $auth->authenticateBolt($protocol, $userAgent);

0 commit comments

Comments
 (0)