Skip to content

Commit a2c0327

Browse files
committed
Java: fix compatibilty with Java 1.8.
It's officially EOL, but there's extended support until 2030, and anyway the Svix library advertises support for it. It's only this line that broke compat, so it's an easy fix.
1 parent c36ae2a commit a2c0327

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

java/lib/src/main/java/com/svix/Svix.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import okhttp3.HttpUrl;
88

9+
import java.util.HashMap;
910
import java.util.Map;
1011

1112
@Getter
@@ -60,10 +61,9 @@ public Svix(String token, SvixOptions options) {
6061
throw new IllegalArgumentException("Invalid base url");
6162
}
6263

63-
Map<String, String> defaultHeaders =
64-
Map.of(
65-
"User-Agent", "svix-libs/" + Version.VERSION + "/java",
66-
"Authorization", "Bearer " + token);
64+
Map<String, String> defaultHeaders = new HashMap<>();
65+
defaultHeaders.put("User-Agent", "svix-libs/" + Version.VERSION + "/java");
66+
defaultHeaders.put("Authorization", "Bearer " + token);
6767

6868
SvixHttpClient httpClient =
6969
new SvixHttpClient(parsedUrl, defaultHeaders, options.getRetrySchedule());

0 commit comments

Comments
 (0)