mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +00:00
correctly set user agent
This commit is contained in:
parent
aad16502fd
commit
3e58f9de5d
1 changed files with 3 additions and 0 deletions
|
|
@ -158,6 +158,8 @@ public class APIHelper implements Action1<Throwable> {
|
||||||
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
|
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String userAgent = System.getProperty("http.agent");
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient.Builder()
|
OkHttpClient client = new OkHttpClient.Builder()
|
||||||
.addInterceptor(remove_data_interceptor)
|
.addInterceptor(remove_data_interceptor)
|
||||||
.addInterceptor(logging)
|
.addInterceptor(logging)
|
||||||
|
|
@ -168,6 +170,7 @@ public class APIHelper implements Action1<Throwable> {
|
||||||
.header("x-api-key", this.hostConfig.getApi())
|
.header("x-api-key", this.hostConfig.getApi())
|
||||||
.header("x-api-user", this.hostConfig.getUser())
|
.header("x-api-user", this.hostConfig.getUser())
|
||||||
.header("x-client", "habitica-android")
|
.header("x-client", "habitica-android")
|
||||||
|
.header("user-agent", userAgent)
|
||||||
.method(original.method(), original.body())
|
.method(original.method(), original.body())
|
||||||
.build();
|
.build();
|
||||||
return chain.proceed(request);
|
return chain.proceed(request);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue