Skip to content

Commit

Permalink
[BUG] fix MainResponse to spoof version number for legacy clients (#708)
Browse files Browse the repository at this point in the history
This commit changes MainResponse to spoof OpenSearch 1.x version numbers as
Legacy version number 7.10.2 for legacy clients.

Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed May 28, 2021
1 parent 053ed7b commit 403c511
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public Build getBuild() {
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(nodeName);
Version.writeVersion(version, out);
if (out.getVersion().before(Version.V_1_0_0)) {
Version.writeVersion(LegacyESVersion.V_7_10_2, out);
} else {
Version.writeVersion(version, out);
}
clusterName.writeTo(out);
out.writeString(clusterUuid);
Build.writeBuild(build, out);
Expand Down

0 comments on commit 403c511

Please sign in to comment.