Skip to content

Commit

Permalink
fix: version file read happens only once (#160)
Browse files Browse the repository at this point in the history
Co-authored-by: Ali Momen Sani <[email protected]>
  • Loading branch information
vagruchi and shaljam authored Dec 12, 2024
1 parent 1d9eaac commit 570548b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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")) {
Expand Down

0 comments on commit 570548b

Please sign in to comment.