Skip to content

Commit

Permalink
fix: version file read happens only once
Browse files Browse the repository at this point in the history
  • Loading branch information
vagruchi committed Oct 30, 2024
1 parent 97a7119 commit e8ded71
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 e8ded71

Please sign in to comment.