Skip to content

Commit 2747c1b

Browse files
committed
Send shorter version. Fixes #765
1 parent 0d1d26b commit 2747c1b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,13 @@ private byte[] CreateConnectionAttributes(string? programName)
14731473
attributesWriter.WriteLengthEncodedString("_client_name");
14741474
attributesWriter.WriteLengthEncodedString("MySqlConnector");
14751475
attributesWriter.WriteLengthEncodedString("_client_version");
1476-
attributesWriter.WriteLengthEncodedString(typeof(ServerSession).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion);
1476+
1477+
var version = typeof(ServerSession).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;
1478+
var plusIndex = version.IndexOf('+');
1479+
if (plusIndex != -1)
1480+
version = version.Substring(0, plusIndex);
1481+
attributesWriter.WriteLengthEncodedString(version);
1482+
14771483
try
14781484
{
14791485
Utility.GetOSDetails(out var os, out var osDescription, out var architecture);

0 commit comments

Comments
 (0)