diff --git a/src/main/java/io/getstream/chat/java/services/framework/DefaultClient.java b/src/main/java/io/getstream/chat/java/services/framework/DefaultClient.java index e42801bc..a7cde751 100644 --- a/src/main/java/io/getstream/chat/java/services/framework/DefaultClient.java +++ b/src/main/java/io/getstream/chat/java/services/framework/DefaultClient.java @@ -95,7 +95,7 @@ private Retrofit buildRetrofitClient() { .newBuilder() .url(url) .header("Content-Type", "application/json") - .header("X-Stream-Client", "stream-java-client-" + getSdkVersion()) + .header("X-Stream-Client", "stream-java-client-" + sdkVersion) .header("Stream-Auth-Type", "jwt") .header("Authorization", jwtToken(apiSecret)) .build(); @@ -203,6 +203,8 @@ private static String getStreamChatBaseUrl(@NotNull Properties properties) { return url.toString(); } + private static final @NotNull String sdkVersion = getSdkVersion(); + private static @NotNull String getSdkVersion() { var clsLoader = DefaultClient.class.getClassLoader(); try (var inputStream = clsLoader.getResourceAsStream("version.properties")) {