mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 04:39:04 +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);
|
||||
}
|
||||
|
||||
String userAgent = System.getProperty("http.agent");
|
||||
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.addInterceptor(remove_data_interceptor)
|
||||
.addInterceptor(logging)
|
||||
|
|
@ -168,6 +170,7 @@ public class APIHelper implements Action1<Throwable> {
|
|||
.header("x-api-key", this.hostConfig.getApi())
|
||||
.header("x-api-user", this.hostConfig.getUser())
|
||||
.header("x-client", "habitica-android")
|
||||
.header("user-agent", userAgent)
|
||||
.method(original.method(), original.body())
|
||||
.build();
|
||||
return chain.proceed(request);
|
||||
|
|
|
|||
Loading…
Reference in a new issue