Set a better User-Agent on requests.

This commit is contained in:
Greyson Parrelli
2020-01-23 12:22:40 -05:00
parent a31da7616d
commit bdb30ebc48
13 changed files with 113 additions and 89 deletions

View File

@@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.giph.model.GiphyImage;
import org.thoughtcrime.securesms.giph.model.GiphyResponse;
import org.thoughtcrime.securesms.net.ContentProxySelector;
import org.thoughtcrime.securesms.net.UserAgentInterceptor;
import org.thoughtcrime.securesms.util.AsyncLoader;
import org.thoughtcrime.securesms.util.JsonUtils;
@@ -39,7 +40,10 @@ public abstract class GiphyLoader extends AsyncLoader<List<GiphyImage>> {
protected GiphyLoader(@NonNull Context context, @Nullable String searchString) {
super(context);
this.searchString = searchString;
this.client = new OkHttpClient.Builder().proxySelector(new ContentProxySelector()).build();
this.client = new OkHttpClient.Builder()
.proxySelector(new ContentProxySelector())
.addInterceptor(new UserAgentInterceptor())
.build();
}
@Override