Skip to content

Commit 4a26a63

Browse files
committed
[Gemini-cli] Update User-Agent for Wikipedia API requests
Updates the User-Agent header to a more specific format, including the app name, contact email, and OkHttp version.
1 parent 3899f06 commit 4a26a63

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

network/src/main/java/com/anysoftkeyboard/janus/network/WikipediaClient.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ class WikipediaClient(context: Context) {
2020

2121
private val okHttpClient =
2222
OkHttpClient.Builder()
23+
.addInterceptor { chain ->
24+
val request =
25+
chain
26+
.request()
27+
.newBuilder()
28+
.header(
29+
"User-Agent",
30+
"Janus-translations-android/1.0 ([email protected]) OkHttp/5.x")
31+
.build()
32+
chain.proceed(request)
33+
}
2334
.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
2435
.cache(cache)
2536
.build()

0 commit comments

Comments
 (0)