Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.

Commit 03128f2

Browse files
committed
Fixed error when api key not provided
1 parent 265005d commit 03128f2

30 files changed

+48
-4
lines changed

src/main/java/com/thoo/api/utils/HttpUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public FortniteInterceptor(String apiKey, Language language) {
5555
}
5656

5757
public okhttp3.Response intercept(Chain chain) throws IOException {
58-
Request request = chain.request().newBuilder()
59-
.header("x-api-key", apiKey).build();
60-
return chain.proceed(request);
58+
Request.Builder requestBuilder = chain.request().newBuilder();
59+
if(apiKey != null) requestBuilder.header("x-api-key", apiKey);
60+
return chain.proceed(requestBuilder.build());
6161
}
6262

6363
}

src/main/java/example/Example.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.thoo.api.FortniteAPI;
44
import com.thoo.api.FortniteAPIBuilder;
55
import com.thoo.api.enums.Language;
6-
import com.thoo.api.utils.HttpUtils;
76

87
public final class Example {
98

-1.52 KB
Binary file not shown.
318 Bytes
Binary file not shown.
132 Bytes
Binary file not shown.
-149 Bytes
Binary file not shown.
56 Bytes
Binary file not shown.
-712 Bytes
Binary file not shown.
433 Bytes
Binary file not shown.
48 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)